Skip to content

Commit

Permalink
rotate x
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristianetaniguti committed Dec 5, 2023
1 parent 9eb362d commit aa0433e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions R/graphics_emp.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ ind_size_graph_emp <- function(data){
geom_text(aes(label= value), position=position_dodge(width=0.9), vjust=-0.25) +
scale_y_continuous(expand = c(.1,.1)) +
labs(x="Genotype call", y = "Number of markers", fill = "SNP call", title = "Number of markers") +
scale_fill_viridis_d(begin=0, end = 0.6) + facet_grid(CountsFrom~.) + theme_bw()
scale_fill_viridis_d(begin=0, end = 0.6) + facet_grid(CountsFrom~.) + theme_bw() + theme(axis.text.x = element_text(angle = 30, hjust=1))

p2 <- data %>% filter(key == "Distance between markers (cM)") %>%
ggplot(aes(x=GenoCall, y=value, color=SNPCall)) +
geom_point(position=position_dodge(width = 0.5)) +
labs(x="Genotype call", y = "Distance between markers (cM)", fill = "SNP call", title = "Genetic distances") +
scale_color_viridis_d(begin=0, end = 0.6) + facet_grid(CountsFrom~.) + theme_bw()
scale_color_viridis_d(begin=0, end = 0.6) + facet_grid(CountsFrom~.) + theme_bw() + theme(axis.text.x = element_text(angle = 30, hjust=1))

ggarrange(p1,p2, common.legend=T)
}
Expand All @@ -177,7 +177,7 @@ all_size_graph_emp <- function(data, stat){
data %>% ggplot(aes(x=GenoCall, y=value, fill=SNPCall)) +
geom_boxplot() + geom_hline(yintercept=0, color="red") +
scale_fill_manual(name="SNP call", values = colors) +
labs(x = "Genotyping method", y = paste(stat, "cM (haldane)"))
labs(x = "Genotyping method", y = paste(stat, "cM (haldane)")) + theme(axis.text.x = element_text(angle = 30, hjust=1))
}

marker_type_graph_emp <- function(data){
Expand All @@ -186,7 +186,7 @@ marker_type_graph_emp <- function(data){
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_viridis_d() +
labs(x = "Genotyping method", y = "Number of markers", fill="Marker type") +
facet_grid(CountsFrom~SNPCall) + theme_bw()
facet_grid(CountsFrom~SNPCall) + theme_bw() + theme(axis.text.x = element_text(angle = 30, hjust=1))
}

times_graph_emp <- function(data){
Expand All @@ -197,15 +197,15 @@ times_graph_emp <- function(data){
scale_y_continuous(expand = c(.1,.1)) +
scale_fill_viridis_d(begin=0, end = 0.6) +
labs(x = "Genotyping method", y = "", fill="SNP call", title = "Number of markers") +
facet_grid(CountsFrom~., scales = "free") + theme_bw()
facet_grid(CountsFrom~., scales = "free") + theme_bw() + theme(axis.text.x = element_text(angle = 30, hjust=1))

p2 <- data %>% filter(key == "time (seconds)") %>% ggplot(aes(x=GenoCall, y=value, fill=SNPCall)) +
geom_bar(stat="identity", position=position_dodge()) +
geom_text(aes(label= round(value,3)), position=position_dodge(width=0.9), vjust=-0.25) +
scale_y_continuous(expand = c(.1,.1)) +
scale_fill_viridis_d(begin=0, end = 0.6) +
labs(x = "Genotyping method", y = "", fill="SNP call", title = "Time spent (seconds)") +
facet_grid(CountsFrom~., scales = "free") + theme_bw()
facet_grid(CountsFrom~., scales = "free") + theme_bw() + theme(axis.text.x = element_text(angle = 30, hjust=1))

ggarrange(p2, p1, common.legend = T)
}
Expand Down
3 changes: 2 additions & 1 deletion R/graphics_simu.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ prepare_datas_simu <- function(x=NULL, example_simu=NULL){

result_list
} else {
cat("Install LargeList:\n devtools::install_github('Yuchun-Zhang/R_largeList', ref = 'v0.3.1', subdir = 'largeList') \n
warning("Install LargeList:\n devtools::install_github('Yuchun-Zhang/R_largeList', ref = 'v0.3.1', subdir = 'largeList') \n
and GUSMap: \n
devtools::install_github('tpbilton/GUSbase', ref = '92119b9c57faa7abeede8236d24a4a8e85fb3df7') \n
devtools::install_github('tpbilton/GUSMap@4d7d4057049819d045750d760a45976c8f30dac6') \n
packages to visualize these results.")
NULL
}
}

Expand Down

0 comments on commit aa0433e

Please sign in to comment.