BRE
plot.info <- read.xlsx("data/TableS6.xlsx", startRow = 3)
colnames(plot.info)[1:3] <- c("Sample","Disease","GroupHormone")
colnames(plot.info) <- str_replace_all(colnames(plot.info), regex(".\\(.+"), "")
colnames(plot.info) <- str_replace_all(colnames(plot.info), regex("/"), "_")
sub.1 <- plot.info[, c(1:3, 19, 4:18)]
sub.1$Group <- "Before"
sub.2 <- plot.info[, c(1:3, 19, 20:34)]
sub.2$Group <- "After"
plot.data <- rbind(sub.1, sub.2)
plot.data$Group <- factor(plot.data$Group, levels = c("Before","After") )
plot.data$Time <- factor(as.character(plot.data$Time), levels = c("day2","day3","day4","day5","day6","day30"))
table(plot.data$Time)
##
## day2 day3 day4 day5 day6 day30
## 44 82 62 34 126 52
p <- ggboxplot(plot.data,
x = "GroupHormone", y = "Lymphocyte._.Monocyte.ratio",
color = "Group", fill = "white",
palette = c("#CE0000","#ffaa00"),
order = names(color.hormone),
width = 0.6, bxp.errorbar = TRUE, bxp.errorbar.width = 0.5,
add = "jitter", add.param = list(color = "Group", size = 1, width = 0.5),
xlab = "", ylab = paste0( "Lymphocyte / Monocyte ratio" ),
main = paste0( "Lymphocyte / Monocyte ratio" ),
legend = "bottom" )
p <- p + stat_compare_means(aes(group = Group, label = paste0(..p.format..)), method = "wilcox.test", paired = T, size = 2 )
p <- p + theme_base() + theme(plot.background = element_blank())
p

p <- ggboxplot(plot.data,
x = "Time", y = "Lymphocyte.count",
color = "Group", fill = "white",
palette = c("#CE0000","#ffaa00"),
width = 0.6, bxp.errorbar = TRUE, bxp.errorbar.width = 0.5,
add = "jitter", add.param = list(color = "Group", size = 1, width = 0.5),
xlab = "", ylab = paste0( "Lymphocyte.count" ),
main = paste0( "Lymphocyte.count" ),
legend = "bottom" )
p <- p + stat_compare_means(aes(group = Group, label = paste0(..p.format..)), method = "wilcox.test", size = 2 )
p <- p + theme_base() + theme(plot.background = element_blank())
p

p <- ggboxplot(plot.data,
x = "Time", y = "Monocyte.count",
color = "Group", fill = "white",
palette = c("#CE0000","#ffaa00"),
width = 0.6, bxp.errorbar = TRUE, bxp.errorbar.width = 0.5,
add = "jitter", add.param = list(color = "Group", size = 1, width = 0.5),
xlab = "", ylab = paste0( "Monocyte.count" ),
main = paste0( "Monocyte.count" ),
legend = "bottom" )
p <- p + stat_compare_means(aes(group = Group, label = paste0(..p.format..)), method = "wilcox.test", size = 2 )
p <- p + theme_base() + theme(plot.background = element_blank())
p

p <- ggboxplot(plot.data,
x = "Time", y = "Lymphocyte._.Monocyte.ratio",
color = "Group", fill = "white",
palette = c("#CE0000","#ffaa00"),
width = 0.6, bxp.errorbar = TRUE, bxp.errorbar.width = 0.5,
add = "jitter", add.param = list(color = "Group", size = 1, width = 0.5),
xlab = "", ylab = paste0( "Lymphocyte / Monocyte ratio" ),
main = paste0( "Lymphocyte / Monocyte ratio" ),
legend = "bottom" )
p <- p + stat_compare_means(aes(group = Group, label = paste0(..p.format..)), method = "wilcox.test", size = 2 )
p <- p + theme_base() + theme(plot.background = element_blank())
p

sub <- plot.data[which(!is.na(plot.data[, "PRL" ])), ]
sub.1 <- table(sub$Sample)
sub.1 <- sub.1[sub.1 > 1]
plot.data.sub <- plot.data[plot.data$Sample %in% names(sub.1), ]
table(plot.data.sub$Time)/2
##
## day2 day3 day4 day5 day6 day30
## 15 37 30 17 55 20
p <- ggboxplot(plot.data.sub,
x = "Time", y = "PRL",
color = "Group", fill = "white",
palette = c("#CE0000","#ffaa00"),
#order = c("FirstVisit", "LastVisit"),
width = 0.6, bxp.errorbar = TRUE, bxp.errorbar.width = 0.5,
add = "jitter", add.param = list(color = "Group", size = 1, width = 0.5),
xlab = "", ylab = paste0( "PRL" ),
main = paste0( "PRL" ),
legend = "bottom" )
p <- p + stat_compare_means(aes(group = Group, label = paste0(..p.format..)), method = "wilcox.test", paired = T, size = 2 )
p <- p + theme_base() + theme(plot.background = element_blank())
p <- p + geom_hline(yintercept = normal.cutoff.male$PRL, linetype="dashed", color = "blue")
p <- p + geom_hline(yintercept = normal.cutoff.female$PRL, linetype="dashed", color = "red")
p

sub <- plot.data[which(!is.na(plot.data[, "GH" ])), ]
sub.1 <- table(sub$Sample)
sub.1 <- sub.1[sub.1 > 1]
plot.data.sub <- plot.data[plot.data$Sample %in% names(sub.1), ]
table(plot.data.sub$Time)/2
##
## day2 day3 day4 day5 day6 day30
## 15 37 30 17 55 20
p <- ggboxplot(plot.data.sub,
x = "Time", y = "GH",
color = "Group", fill = "white",
palette = c("#CE0000","#ffaa00"),
#order = c("FirstVisit", "LastVisit"),
width = 0.6, bxp.errorbar = TRUE, bxp.errorbar.width = 0.5,
add = "jitter", add.param = list(color = "Group", size = 1, width = 0.5),
xlab = "", ylab = paste0( "GH" ),
main = paste0( "GH" ),
legend = "bottom" )
p <- p + stat_compare_means(aes(group = Group, label = paste0(..p.format..)), method = "wilcox.test", paired = T, size = 2 )
p <- p + theme_base() + theme(plot.background = element_blank())
p <- p + geom_hline(yintercept = normal.cutoff.male$GH, linetype="dashed", color = "blue")
p <- p + geom_hline(yintercept = normal.cutoff.female$GH, linetype="dashed", color = "red")
p

sub <- plot.data[which(!is.na(plot.data[, "ACTH" ])), ]
sub.1 <- table(sub$Sample)
sub.1 <- sub.1[sub.1 > 1]
plot.data.sub <- plot.data[plot.data$Sample %in% names(sub.1), ]
table(plot.data.sub$Time)/2
##
## day2 day3 day4 day5 day6 day30
## 15 37 30 17 55 20
p <- ggboxplot(plot.data.sub,
x = "Time", y = "ACTH",
color = "Group", fill = "white",
palette = c("#CE0000","#ffaa00"),
#order = c("FirstVisit", "LastVisit"),
width = 0.6, bxp.errorbar = TRUE, bxp.errorbar.width = 0.5,
add = "jitter", add.param = list(color = "Group", size = 1, width = 0.5),
xlab = "", ylab = paste0( "ACTH" ),
main = paste0( "ACTH" ),
legend = "bottom" )
p <- p + stat_compare_means(aes(group = Group, label = paste0(..p.format..)), method = "wilcox.test", paired = T, size = 2 )
p <- p + theme_base() + theme(plot.background = element_blank())
p <- p + geom_hline(yintercept = normal.cutoff.male$ACTH, linetype="dashed", color = "blue")
p <- p + geom_hline(yintercept = normal.cutoff.female$ACTH, linetype="dashed", color = "red")
p
