From aebf22e07ab91e9d0f40342f9b62b361e9459d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20S=20Jaro=C5=88?= <376090@mail.muni.cz> Date: Tue, 16 Jun 2020 17:24:15 +0200 Subject: [PATCH] figure scripts updates --- scripts/plot_figure_1_questions.R | 2 +- scripts/plot_figure_2_heterozygosity.R | 18 +++++++++++------- ...ure_S6_expected_heterozygosity_structure.R} | 2 +- ...=> plot_figure_S8_TEs_vs_mode_and_origin.R} | 2 +- ...igure_S8_BUSCO.R => plot_figure_S9_BUSCO.R} | 0 scripts/print_values_for_manu.R | 16 ++++++++++++++-- 6 files changed, 28 insertions(+), 12 deletions(-) rename scripts/{plot_figure_S4_expected_heterozygosity_structure.R => plot_figure_S6_expected_heterozygosity_structure.R} (98%) rename scripts/{plot_figure_S7_TEs_vs_mode_and_origin.R => plot_figure_S8_TEs_vs_mode_and_origin.R} (98%) rename scripts/{plot_figure_S8_BUSCO.R => plot_figure_S9_BUSCO.R} (100%) diff --git a/scripts/plot_figure_1_questions.R b/scripts/plot_figure_1_questions.R index 1139ec4..a182808 100644 --- a/scripts/plot_figure_1_questions.R +++ b/scripts/plot_figure_1_questions.R @@ -142,7 +142,7 @@ if ( both ){ } if (refs && both && tricolor){ - file_to_save <- "figures/SM_Figure_1_genomic_studies.pdf" + file_to_save <- "figures/SM_Figure_3_genomic_studies.pdf" } pdf(file_to_save, width = 8, height = height, pointsize = 8) diff --git a/scripts/plot_figure_2_heterozygosity.R b/scripts/plot_figure_2_heterozygosity.R index a2e833c..3d37aff 100644 --- a/scripts/plot_figure_2_heterozygosity.R +++ b/scripts/plot_figure_2_heterozygosity.R @@ -128,7 +128,7 @@ plot_corpus <- function(presentation = F){ axis(1, labels = hyb_origins, at = 1:3, tick = F, line = F, cex.axis = general_cex) # Apis elipse - filledellipse(rx1 = 0.15, ry1 = 1.5, col = ellipse_col, angle = 0, dr = 0.1, mid = c(1.24, 1.5)) + filledellipse(rx1 = 0.13, ry1 = 1.4, col = ellipse_col, angle = 0, dr = 0.1, mid = c(1.28, 1.5)) if ( presentation & !split_axis ) { filledellipse(rx1 = 3.5, ry1 = 0.21, col = ellipse_col, angle = 90.8, dr = 0.1, mid = c(1.97, 9.3)) filledellipse(rx1 = 3.8, ry1 = 0.2, col = ellipse_col, angle = 87.5, dr = 0.1, mid = c(3.13, 6)) @@ -148,11 +148,11 @@ plot_corpus <- function(presentation = F){ } if ( split_axis ){ if ( homoeolog ){ - filledellipse(rx1 = 3.6, ry1 = 0.28, col = ellipse_col, angle = 90, dr = 0.1, mid = c(2.05, 14.55)) + filledellipse(rx1 = 3.6, ry1 = 0.28, col = ellipse_col, angle = 90, dr = 0.1, mid = c(2.15, 14.55)) # Meloidogyne - filledellipse(rx1 = 3.8, ry1 = 0.24, col = ellipse_col, angle = 86.5, dr = 0.1, mid = c(3.17, 6)) + filledellipse(rx1 = 3.9, ry1 = 0.22, col = ellipse_col, angle = 88, dr = 0.1, mid = c(3.12, 6)) # diploscapter - filledellipse(rx1 = 0.16, ry1 = 1.3, col = ellipse_col, angle = 0, dr = 0.1, mid = c(2.67, 4.6)) + filledellipse(rx1 = 0.098, ry1 = 1.8, col = ellipse_col, angle = 0, dr = 0.1, mid = c(2.77, 5.5)) } else { filledellipse(rx1 = 6.5, ry1 = 0.25, col = ellipse_col, angle = 90, dr = 0.1, mid = c(2.06, 17.5)) } @@ -180,9 +180,9 @@ plot_corpus <- function(presentation = F){ c("gamete duplication", "terminal fusion", "central fusion", - "unknown meiosis", + "unknown meiotic", "unknown", - "functional mitosis"), + "functional mitotic"), col = pal, pch = c(rep(20,6)), cex = ifelse(presentation, 1.5, 1.2)) # legend('topleft', bty = 'n', # c("gamete duplication", "terminal fusion", "central fusion", "unknown automixis", "unknown", "functional apomixis", @@ -198,6 +198,10 @@ plot_ploits <- function(hyb_origin = "no", presentation = F){ subset <- subset[order(subset$callular_mechanism),] subset <- subset[!is.na(subset$heterozygosity),] + if (hyb_origin == "yes"){ + subset <- subset[c(2,1,5,3,6:9,4),] + } + at <- which(hyb_origin == hyb_origins) misplacement <- seq(from = -0.45, to = 0.45, length = nrow(subset) + 2)[2:(nrow(subset)+1)] # symbols <- c(NA, 19, 17, 15) @@ -259,7 +263,7 @@ if ( homoeolog ){ misplacement <- seq(from = -0.45, to = 0.45, length = unknown_repr + 2)[2:(unknown_repr+1)] print(misplacement) - xpos <- 2 + misplacement[c(4,5,6,7)] + xpos <- 2 + misplacement[c(5:8)] # symbols <- c(NA, 19, 17, 15) # conture_symbols <- c(NA, 21, 24, 22) rotifers_to_plot <- rotifers_ohno - (g_to - g_from) diff --git a/scripts/plot_figure_S4_expected_heterozygosity_structure.R b/scripts/plot_figure_S6_expected_heterozygosity_structure.R similarity index 98% rename from scripts/plot_figure_S4_expected_heterozygosity_structure.R rename to scripts/plot_figure_S6_expected_heterozygosity_structure.R index a863b0c..d6ce6f2 100644 --- a/scripts/plot_figure_S4_expected_heterozygosity_structure.R +++ b/scripts/plot_figure_S6_expected_heterozygosity_structure.R @@ -24,7 +24,7 @@ total_heterozygosities <- seq(0, 8, len = 100) triallelic_exp <- sapply(total_heterozygosities, get_exp_triallelic) # tiff("figures/supp_fig4_expected_triallelic.tiff", width = 800, height = 600, 'px', res = 100, compression = 'rle') -pdf("figures/SM_Figure_4_expected_triallelic.pdf", width = 8, height = 6) +pdf("figures/SM_Figure_6_expected_triallelic.pdf", width = 8, height = 6) plot(triallelic_exp ~ total_heterozygosities, xlab = 'Heterozygosity [%]', diff --git a/scripts/plot_figure_S7_TEs_vs_mode_and_origin.R b/scripts/plot_figure_S8_TEs_vs_mode_and_origin.R similarity index 98% rename from scripts/plot_figure_S7_TEs_vs_mode_and_origin.R rename to scripts/plot_figure_S8_TEs_vs_mode_and_origin.R index 6799853..0acd1ad 100644 --- a/scripts/plot_figure_S7_TEs_vs_mode_and_origin.R +++ b/scripts/plot_figure_S8_TEs_vs_mode_and_origin.R @@ -94,7 +94,7 @@ plot_ploits <- function(hyb_origin = "no", .var = "repeats"){ #### plot_tab <- genome_tab[!is.na(genome_tab$TEs),] -tiff("figures/SM_Figure_7_TEs.tiff", +tiff("figures/SM_Figure_8_TEs.tiff", width = 8, height = 8, units = 'in', res = 90) # # png('figures/Supp_fig2b_TEs.png') diff --git a/scripts/plot_figure_S8_BUSCO.R b/scripts/plot_figure_S9_BUSCO.R similarity index 100% rename from scripts/plot_figure_S8_BUSCO.R rename to scripts/plot_figure_S9_BUSCO.R diff --git a/scripts/print_values_for_manu.R b/scripts/print_values_for_manu.R index fa6c935..c092f3f 100644 --- a/scripts/print_values_for_manu.R +++ b/scripts/print_values_for_manu.R @@ -8,15 +8,27 @@ tab_file <- 'tables/genome_table.tsv' genome_tab <- read.table(tab_file, header = T, stringsAsFactors = F, skip = 1, check.names = F) # get unique species -genome_tab <- genome_tab[!genome_tab$code %in% c('Ps591', 'Ps791', 'Dpul1', 'Dpul2', 'Dpul3', 'Dpul4', 'Mjav1', 'Mare1', 'Mare3', 'Minc1'),] +genome_tab <- genome_tab[!genome_tab$code %in% c('Ps591', 'Ps791', 'Dpul1', 'Dpul4', 'Mjav1', 'Mare1', 'Mare3', 'Minc1'),] diploids <- genome_tab$ploidy == 2 & !is.na(genome_tab$ploidy) otherploids <- genome_tab$ploidy != 2 & !is.na(genome_tab$ploidy) number_of_species <- length(unique(genome_tab$species)) +genome_tab$callular_mechanism[is.na(genome_tab$callular_mechanism)] <- "unknown" +genome_tab$hybrid_origin[is.na(genome_tab$hybrid_origin)] <- "unknown" +cellular_mechs <- aggregate(callular_mechanism ~ species, data=genome_tab, FUN=function(x){x[1]}) + +mitotic_parth <- genome_tab[genome_tab$callular_mechanism == 'functional_apomixis',] +table(aggregate(ploidy ~ species, data=mitotic_parth, FUN=function(x){x[1]})$ploidy) + +meiotic_parth <- genome_tab[!genome_tab$callular_mechanism %in% c('functional_apomixis', 'unknown'),] +table(aggregate(ploidy ~ species, data=meiotic_parth, FUN=function(x){x[1]})$ploidy) + +hybrid_orig <- aggregate(hybrid_origin ~ species, data=genome_tab, FUN=function(x){x[1]}) + # # genomes -cat("Number of reanalyzed genomes: ", number_of_species, "\n") +cat("Number of reanalyzed species: ", number_of_species, "\n") # genome sizes cat("Range of haploid sizes [Mbp]:", paste(range(c(genome_tab[,'assembly_size[M]'], genome_tab[,'haploid_length[M]']), na.rm=T)), "\n")