Skip to content

Commit

Permalink
figure scripts updates
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilSJaron committed Jun 16, 2020
1 parent 9912087 commit aebf22e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion scripts/plot_figure_1_questions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 11 additions & 7 deletions scripts/plot_figure_2_heterozygosity.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
}
Expand Down Expand Up @@ -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",
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 [%]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
File renamed without changes.
16 changes: 14 additions & 2 deletions scripts/print_values_for_manu.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit aebf22e

Please sign in to comment.