Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

createfigure.R 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ## All GAL4-rescues into one figure
  2. ## data for each group were calculated by runCetran.r code and saved in one table
  3. ## groups were added to the table manually
  4. library(dplyr)
  5. library("plyr")
  6. library("ggplot2")
  7. library(EnvStats)
  8. allori <- read.csv("03_data/990_processed_data/rescues_buridan_uasonIII_output/output _table_corr.csv",
  9. dec=",")
  10. grouping = data.frame(group =unique(allori$group))
  11. grouping$genorder = c(1:20)
  12. grouping$order_for_figure = rep(c("a","b","c","d"),5)
  13. grouping$females = rep(c("w+;;UAS-t-beta-h","t-beta-h",rep("t-beta-h;;UAS-t-beta-h",2)),5)
  14. grouping$gal4= c(rep("actin-",4),rep("nsyb-",4),rep("tdc1-",4),rep("tdc2-",4),rep("np7088-",4))
  15. grouping$males2 = rep(rep(c("CS", "Gal4"),2),5)
  16. grouping=grouping %>% mutate (males =ifelse(males2 !="Gal4",males2 ,paste0(gal4,"Gal4")))
  17. grouping$males
  18. all = left_join(allori,grouping)
  19. #all <- read.csv2("E:/DiffDom manuscript data/TA-rec_homo.csv")
  20. #attach(all)
  21. #install.packages("ddply")
  22. ## speed ####
  23. call<- ddply(all, .(genorder,group,order_for_figure), summarise, # .()includes all the variables
  24. N = length(median_speed),
  25. speeds = mean(median_speed),
  26. sd = sd(median_speed),
  27. se = sd(median_speed) / sqrt(length(median_speed)) )
  28. p1=call %>%
  29. arrange(genorder) %>% # First sort by val. This sort the dataframe but NOT the factor levels
  30. mutate(group=factor(group, levels=group)) %>%
  31. ggplot( aes(x=group, y=speeds, fill=order_for_figure)) +
  32. geom_bar(stat="identity",position=position_dodge(),col="black") +
  33. geom_errorbar(aes(ymin=speeds-se, ymax=speeds+se),
  34. width=.2,position=position_dodge(.9)) +
  35. ylab("Walking Speed [mm/s]") +
  36. xlab("") + # column fill and legend title/ -lables
  37. scale_y_continuous(breaks=0:16*4, limits = c(0,30)) +
  38. scale_fill_manual(values=c("white","grey","grey","lightblue")) + #fill_manual muss nach fill_discrete stehen
  39. theme(axis.title.x = element_text(size=20), #(face="bold", colour="black")
  40. axis.title.y = element_text(angle=90,size=20),
  41. axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1),
  42. #axis.line = element_line(colour = "black"),
  43. panel.grid.major = element_blank(),
  44. legend.position ="none",
  45. panel.grid.minor = element_blank(),
  46. axis.line.x = element_line(color="black", size = 0.5),
  47. axis.line.y = element_line(color="black", size = 0.5),
  48. panel.background = element_blank(),
  49. panel.border = element_blank())
  50. ## fixation ####
  51. p2=all %>%
  52. arrange(genorder) %>% # First sort by val. This sort the dataframe but NOT the factor levels
  53. mutate(group=factor(group,levels = unique(group))) %>%
  54. ggplot( aes(x=group, y=stripe_deviation, fill=order_for_figure)) +
  55. geom_boxplot() +
  56. stat_n_text(size = 2)+
  57. ylab("Stripe deviation [?]") +
  58. xlab("") +
  59. scale_fill_manual(values=c("white","grey","grey","lightblue"),name="") + # column fill and legend title/ -lables
  60. scale_y_continuous(breaks=0:16*5, limits = c(-10,75)) +
  61. theme_bw() + # to make background white, has to be before "opts"
  62. theme(axis.title.x = element_text(size=20), #(face="bold", colour="black")
  63. axis.title.y = element_text(angle=90,size=20),
  64. #axis.text.x = element_text(hjust=0.5, size=16),
  65. axis.line = element_line(colour = "black"),
  66. panel.grid.major = element_blank(),
  67. panel.grid.minor = element_blank(),
  68. legend.position ="none",
  69. axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1),
  70. #panel.grid.major = theme_blank(),
  71. #panel.grid.minor = theme_blank(),
  72. #panel.border = theme_blank(),
  73. #panel.background = theme_blank()
  74. )
  75. pdf ("05_figures/fig2/outputfigurerescueIII_2.pdf")
  76. gridExtra::grid.arrange(p1, p2, nrow = 2)
  77. dev.off()
  78. #aSTATISTICS
  79. sink ("05_figures/fig2/outputfigurerescueIII_stats.txt")
  80. for (i in c(0:4)){
  81. #i=0
  82. data = all %>% filter (group %in% unique(all$group)[(4*i+1):(4*i+4)])
  83. data =droplevels(data)
  84. x=aov(data$median_speed~data$group)
  85. print ("speed")
  86. print(summary(x))
  87. print(TukeyHSD(x))
  88. print ("angledev")
  89. print(pairwise.wilcox.test(data$stripe_deviation,data$group,p.adjust="bonferroni"))
  90. }
  91. sink()