-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'career-2023' of https://github.com/anyaevostinar/Symbul…
…ationEmp into career-2023
- Loading branch information
Showing
7 changed files
with
180 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
require(ggplot2) | ||
#install.packages("viridis") | ||
library(viridis) | ||
library(scales) | ||
|
||
#Set your working directory to the Analysis folder for your project | ||
|
||
#Read in the data | ||
initial_data <- read.table("04-25-22-ParaSpatial/munged_basic.dat", h=T) | ||
initial_data$task <- factor(initial_data$task, levels=c("NOT", "NAND", "AND", "ORN", "OR", "ANDN", "NOR", "XOR", "EQU")) | ||
initial_data[2] <- data.frame(lapply(initial_data[2], function(x) {gsub("Grid0", "Well-mixed", x)})) | ||
initial_data[2] <- data.frame(lapply(initial_data[2], function(x) {gsub("Grid1", "Structured", x)})) | ||
final_update <- subset(initial_data, update == "40000") | ||
|
||
host_data <- subset(final_update, partner == "Host") | ||
|
||
#Plot the host task counts at final update | ||
|
||
#violin plot? | ||
ggplot(data=host_data, aes(x=treatment, y=count, color=treatment)) + geom_violin() + ylab("Task Count Final Update") + xlab("Parasites Present or Absent") + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) + scale_color_manual(name="Parasites", values=viridis(3)) + facet_wrap(~task, scales = "free") + geom_boxplot(alpha=0.5, outlier.size=0, width=0.1) | ||
|
||
#regular box plot | ||
ggplot(data=host_data, aes(x=treatment, y=count, color=treatment)) + geom_boxplot(alpha=0.5, outlier.size=1) + ylab("Task Count Final Update") + xlab("Parasites Present or Absent") + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) + scale_color_manual(name="Parasites", values=viridis(3)) + facet_wrap(~task, scales = "free") | ||
|
||
|
||
|
||
wilcox.test(subset(host_data, treatment=="Absent" & task=="NOT")$count, subset(host_data, treatment=="Present" & task=="NOT")$count) | ||
median(subset(host_data, treatment=="Absent" & task=="NOT")$count) | ||
median(subset(host_data, treatment=="Present" & task=="NOT")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="NAND")$count, subset(host_data, treatment=="Present" & task=="NAND")$count) | ||
median(subset(host_data, treatment=="Absent" & task=="NAND")$count) | ||
median(subset(host_data, treatment=="Present" & task=="NAND")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="AND")$count, subset(host_data, treatment=="Present" & task=="AND")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="ANDN")$count, subset(host_data, treatment=="Present" & task=="ANDN")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="OR")$count, subset(host_data, treatment=="Present" & task=="OR")$count) | ||
median(subset(host_data, treatment=="Absent" & task=="OR")$count) | ||
median(subset(host_data, treatment=="Present" & task=="OR")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="ORN")$count, subset(host_data, treatment=="Present" & task=="ORN")$count) | ||
|
||
#All tasks over time | ||
ggplot(data=initial_data, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(task ~ partner, scales='free') | ||
|
||
# Specific host tasks over time | ||
host_over_time <- subset(initial_data, partner=="Host") | ||
limited_tasks <- subset(host_over_time, task=="NOT" | task=="NAND" | task=="AND" | task=="ORN" | task=="OR" | task=="ANDN") | ||
|
||
ggplot(data=limited_tasks, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(name = "Parasites", values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(task ~ ., scales='free') | ||
|
||
# Specific parasite tasks over time | ||
parasite_over_time <- subset(initial_data, partner=="Parasite") | ||
para_limited_tasks <- subset(parasite_over_time, task=="NOT" | task=="NAND" | task=="AND" | task=="ORN" | task=="OR") | ||
|
||
ggplot(data=para_limited_tasks, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(name = "Parasites", values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(task ~ ., scales='free') | ||
|
||
#Tasks over time by replicate | ||
NAND <- subset(initial_data, task=="NAND") | ||
NOT <- subset(initial_data, task=="NOT") | ||
AND <- subset(initial_data, task=="AND") | ||
|
||
ggplot(data=NOT, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(partner~rep, scales='free') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
require(ggplot2) | ||
#install.packages("viridis") | ||
library(viridis) | ||
library(scales) | ||
|
||
#Set your working directory to the Analysis folder for your project | ||
|
||
#Read in the data | ||
initial_data <- read.table("04-25-22-SpatialNoPara/munged_basic.dat", h=T) | ||
initial_data$task <- factor(initial_data$task, levels=c("NOT", "NAND", "AND", "ORN", "OR", "ANDN", "NOR", "XOR", "EQU")) | ||
final_update <- subset(initial_data, update == "40000") | ||
|
||
host_data <- subset(final_update, partner == "Host") | ||
|
||
#Plot the host task counts at final update | ||
|
||
#violin plot? | ||
ggplot(data=host_data, aes(x=treatment, y=count, color=treatment)) + geom_violin() + ylab("Task Count Final Update") + xlab("Parasites Present or Absent") + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) + scale_color_manual(name="Parasites", values=viridis(3)) + facet_wrap(~task, scales = "free") + geom_boxplot(alpha=0.5, outlier.size=0, width=0.1) | ||
|
||
#regular box plot | ||
ggplot(data=host_data, aes(x=treatment, y=count, color=treatment)) + geom_boxplot(alpha=0.5, outlier.size=1) + ylab("Task Count Final Update") + xlab("Parasites Present or Absent") + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) + scale_color_manual(name="Parasites", values=viridis(3)) + facet_wrap(~task, scales = "free") | ||
|
||
|
||
|
||
wilcox.test(subset(host_data, treatment=="Absent" & task=="NOT")$count, subset(host_data, treatment=="Present" & task=="NOT")$count) | ||
median(subset(host_data, treatment=="Absent" & task=="NOT")$count) | ||
median(subset(host_data, treatment=="Present" & task=="NOT")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="NAND")$count, subset(host_data, treatment=="Present" & task=="NAND")$count) | ||
median(subset(host_data, treatment=="Absent" & task=="NAND")$count) | ||
median(subset(host_data, treatment=="Present" & task=="NAND")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="AND")$count, subset(host_data, treatment=="Present" & task=="AND")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="ANDN")$count, subset(host_data, treatment=="Present" & task=="ANDN")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="OR")$count, subset(host_data, treatment=="Present" & task=="OR")$count) | ||
median(subset(host_data, treatment=="Absent" & task=="OR")$count) | ||
median(subset(host_data, treatment=="Present" & task=="OR")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="ORN")$count, subset(host_data, treatment=="Present" & task=="ORN")$count) | ||
|
||
#All tasks over time | ||
ggplot(data=initial_data, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(task ~ partner, scales='free') | ||
|
||
# Specific host tasks over time | ||
host_over_time <- subset(initial_data, partner=="Host") | ||
limited_tasks <- subset(host_over_time, task=="NOT" | task=="NAND" | task=="AND" | task=="ORN" | task=="OR" | task=="ANDN") | ||
|
||
ggplot(data=limited_tasks, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(name = "Parasites", values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(task ~ ., scales='free') | ||
|
||
# Specific parasite tasks over time | ||
parasite_over_time <- subset(initial_data, partner=="Parasite") | ||
para_limited_tasks <- subset(parasite_over_time, task=="NOT" | task=="NAND" | task=="AND" | task=="ORN" | task=="OR") | ||
|
||
ggplot(data=para_limited_tasks, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(name = "Parasites", values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(task ~ ., scales='free') | ||
|
||
#Tasks over time by replicate | ||
NAND <- subset(initial_data, task=="NAND") | ||
NOT <- subset(initial_data, task=="NOT") | ||
AND <- subset(initial_data, task=="AND") | ||
|
||
ggplot(data=NOT, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(partner~rep, scales='free') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
require(ggplot2) | ||
#install.packages("viridis") | ||
library(viridis) | ||
library(scales) | ||
|
||
#Set your working directory to the Analysis folder for your project | ||
|
||
#Read in the data | ||
initial_data <- read.table("04-25-22-ParaSpatial/munged_basic.dat", h=T) | ||
initial_data$task <- factor(initial_data$task, levels=c("NOT", "NAND", "AND", "ORN", "OR", "ANDN", "NOR", "XOR", "EQU")) | ||
initial_data[2] <- data.frame(lapply(initial_data[2], function(x) {gsub("Grid0", "Well-mixed", x)})) | ||
initial_data[2] <- data.frame(lapply(initial_data[2], function(x) {gsub("Grid1", "Structured", x)})) | ||
final_update <- subset(initial_data, update == "40000") | ||
|
||
host_data <- subset(final_update, partner == "Host") | ||
|
||
#Plot the host task counts at final update | ||
|
||
#violin plot? | ||
ggplot(data=host_data, aes(x=treatment, y=count, color=treatment)) + geom_violin() + ylab("Task Count Final Update") + xlab("Parasites Present or Absent") + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) + scale_color_manual(name="Parasites", values=viridis(3)) + facet_wrap(~task, scales = "free") + geom_boxplot(alpha=0.5, outlier.size=0, width=0.1) | ||
|
||
#regular box plot | ||
ggplot(data=host_data, aes(x=treatment, y=count, color=treatment)) + geom_boxplot(alpha=0.5, outlier.size=1) + ylab("Task Count Final Update") + xlab("Parasites Present or Absent") + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) + scale_color_manual(name="Parasites", values=viridis(3)) + facet_wrap(~task, scales = "free") | ||
|
||
|
||
|
||
wilcox.test(subset(host_data, treatment=="Absent" & task=="NOT")$count, subset(host_data, treatment=="Present" & task=="NOT")$count) | ||
median(subset(host_data, treatment=="Absent" & task=="NOT")$count) | ||
median(subset(host_data, treatment=="Present" & task=="NOT")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="NAND")$count, subset(host_data, treatment=="Present" & task=="NAND")$count) | ||
median(subset(host_data, treatment=="Absent" & task=="NAND")$count) | ||
median(subset(host_data, treatment=="Present" & task=="NAND")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="AND")$count, subset(host_data, treatment=="Present" & task=="AND")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="ANDN")$count, subset(host_data, treatment=="Present" & task=="ANDN")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="OR")$count, subset(host_data, treatment=="Present" & task=="OR")$count) | ||
median(subset(host_data, treatment=="Absent" & task=="OR")$count) | ||
median(subset(host_data, treatment=="Present" & task=="OR")$count) | ||
wilcox.test(subset(host_data, treatment=="Absent" & task=="ORN")$count, subset(host_data, treatment=="Present" & task=="ORN")$count) | ||
|
||
#All tasks over time | ||
ggplot(data=initial_data, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(task ~ partner, scales='free') | ||
|
||
# Specific host tasks over time | ||
host_over_time <- subset(initial_data, partner=="Host") | ||
limited_tasks <- subset(host_over_time, task=="NOT" | task=="NAND" | task=="AND" | task=="ORN" | task=="OR" | task=="ANDN") | ||
|
||
ggplot(data=limited_tasks, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(name = "Parasites", values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(task ~ ., scales='free') | ||
|
||
# Specific parasite tasks over time | ||
parasite_over_time <- subset(initial_data, partner=="Parasite") | ||
para_limited_tasks <- subset(parasite_over_time, task=="NOT" | task=="NAND" | task=="AND" | task=="ORN" | task=="OR") | ||
|
||
ggplot(data=para_limited_tasks, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(name = "Parasites", values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(task ~ ., scales='free') | ||
|
||
#Tasks over time by replicate | ||
NAND <- subset(initial_data, task=="NAND") | ||
NOT <- subset(initial_data, task=="NOT") | ||
AND <- subset(initial_data, task=="AND") | ||
|
||
ggplot(data=NOT, aes(x=update, y=count, group=treatment, colour=treatment)) + ylab("Task count") + xlab("Updates") + stat_summary(aes(color=treatment, fill=treatment),fun.data="mean_cl_boot", geom=c("smooth"), se=TRUE) + theme(panel.background = element_rect(fill='white', colour='black')) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + guides(fill=FALSE) +scale_colour_manual(values=viridis(3)) + scale_fill_manual(values=viridis(3)) + facet_grid(partner~rep, scales='free') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters