Commits

Giovanni Marco Dall'Olio committed bc18a6b

SIMS: removed the real data chr22 dataset from the plots

  • Participants
  • Parent commits dfe12e2

Comments (0)

Files changed (3)

File results/plots/selection_vs_neutral/simulations_NeutralVsSelection.pdf

Binary file modified.

File results/plots/selection_vs_neutral/simulations_NeutralVsSelection_debug.pdf

Binary file modified.

File src/plot_simulations_NeutralVsSelection.R

     current_data = subset(results_and_annotations.long, network_property %in% properties)
     current_data.glob = subset(current_data, continent == current_pop)
     if (arg_values$include_ancient == T) {
-        xscale = scale_x_discrete(limits=c("realdata", "neutral", "ancient", "recent"), labels=x_labels)
+#        xscale = scale_x_discrete(limits=c("realdata", "neutral", "ancient", "recent"), labels=x_labels)
+        xscale = scale_x_discrete(limits=c("neutral", "ancient", "recent"), labels=x_labels)
     } else {
-        xscale = scale_x_discrete(limits=c("realdata", "neutral", "recent"), labels=x_labels)
+#        xscale = scale_x_discrete(limits=c("realdata", "neutral", "recent"), labels=x_labels)
+        xscale = scale_x_discrete(limits=c("neutral", "recent"), labels=x_labels)
     }
 
     # WILCOXON TEST
                      )
     
     } else if (arg_values$plot_type == "barcharts") {
-        realvalues = which(current_data.glob$dataset == 'realdata')
+#        realvalues = which(current_data.glob$dataset == 'realdata')
 #        print(realvalues)
 #        print(current_data.glob[realvalues,]$value)
-        current_data.glob[realvalues,]$value =  -current_data.glob[realvalues,]$value
+#        current_data.glob[realvalues,]$value =  -current_data.glob[realvalues,]$value
         neutralVsSelectionPlot = list(base_neutralVsSelectionPlot,
-                                      geom_bar(aes(abs(value), color=dataset, fill=dataset), stat='bin', binwidth=0.1, position='dodge'),
+#                                      geom_bar(aes(abs(value), color=dataset, fill=dataset), stat='bin', binwidth=0.1, position='dodge'),
+                                      geom_density(aes(value, color=dataset, fill=dataset), alpha=0.2, stat='bin', binwidth=0.1, position='dodge'),
 #                                      geom_freqpoly(x=aes(abs(value), colour=dataset, group = dataset),  stat='bin'),
                                       facet_wrap(~network_property, scales='free')
                                       
         p <- ggplot(aes(y=value, fill=dataset), data=current_data.glob)
         print (p + neutralVsSelectionPlot)
     }
-    print("odsasdal")
 
     print(summary(current_data))
 }
 neutralsims$dataset = "neutral"
 selectionsims = read.table(arg_values$selectionsims, header=T)
 selectionsims$dataset = "recent"
-realdata = read.table(arg_values$realdata, header=T)
-realdata = subset(realdata, continent != "glob")
-realdata$continent = gsub("global_noAMR", "glob", realdata$continent)
-realdata$dataset = "realdata"
+#realdata = read.table(arg_values$realdata, header=T)
+#realdata = subset(realdata, continent != "glob")
+#realdata$continent = gsub("global_noAMR", "glob", realdata$continent)
+#realdata$dataset = "realdata"
 
 if (arg_values$include_ancient == T){
     ancientsims = read.table(arg_values$ancientsims, header=T)
     ancientsims$dataset = "ancient"
-    results_and_annotations = rbind(realdata, neutralsims, selectionsims, ancientsims)
+#    results_and_annotations = rbind(realdata, neutralsims, selectionsims, ancientsims)
+    results_and_annotations = rbind(neutralsims, selectionsims, ancientsims)
     x_labels = c(
-            "Real data,\nchromosome 22",
+#            "Real data,\nchromosome 22",
             "Neutral\nSimulations", 
             "Ancient compl. sweep\nSelection coeff.: 0.02\nFinal Freq.: 0.90\nSweep ended:\n5000 generations ago",
             "Recent compl. sweep\nSelection coeff.: 0.015\nFinal Freq.: 0.99\nSweep ended:\n0 generations ago"
             )
 
 } else {
-    results_and_annotations = rbind(realdata, neutralsims, selectionsims)
+#    results_and_annotations = rbind(realdata, neutralsims, selectionsims)
+    results_and_annotations = rbind(neutralsims, selectionsims)
     x_labels = c(
-            "Real data,\nchromosome 22",
+#            "Real data,\nchromosome 22",
              "Neutral\nSimulations", 
             "Recent compl. sweep\nSelection coeff.: 0.015\nFinal Freq.: 0.99\nSweep ended:\n0 generations ago"
             )
 #    plot_boxplot_allannotations_byproperty(current_network_property)  
 #}
 
-plot_boxplot_allannotations_manypropertiesperpage(properties_to_plot, current_pop="glob")
+#plot_boxplot_allannotations_manypropertiesperpage(properties_to_plot, current_pop="glob")
 plot_boxplot_allannotations_manypropertiesperpage(properties_to_plot, current_pop="EUR")
 
 print(paste("saved plots to", arg_values$outputfile))