...
|
...
|
@@ -50,7 +50,7 @@
|
50
|
50
|
#' viz_pwm(pwm_mat = pwm, method = "bits", fixed_coord = TRUE)
|
51
|
51
|
#'
|
52
|
52
|
viz_pwm <- function(pwm_mat, method = "heatmap", pos_lab = NULL,
|
53
|
|
- pdf_name = NULL, fixed_coord = FALSE, bits_yax = "full"){
|
|
53
|
+ pdf_name = NULL, fixed_coord = FALSE, bits_yax = "full"){
|
54
|
54
|
|
55
|
55
|
pos_lab <- set_default_pos_lab2(pwm_mat, pos_lab)
|
56
|
56
|
check_vars(pwm_mat, pos_lab)
|
...
|
...
|
@@ -61,7 +61,7 @@ viz_pwm <- function(pwm_mat, method = "heatmap", pos_lab = NULL,
|
61
|
61
|
pwm_mat_df$Nucleotides <- rownames(pwm_mat_df)
|
62
|
62
|
colnames(pwm_mat_df) <- c(pos_lab, "Nucleotides")
|
63
|
63
|
pwm_mat_df_for_ggheatmap <- melt(pwm_mat_df, id.vars = c("Nucleotides"),
|
64
|
|
- variable.name = "positions")
|
|
64
|
+ variable.name = "positions")
|
65
|
65
|
p1 <- get_ggheatmap(pwm_mat_df = pwm_mat_df_for_ggheatmap)
|
66
|
66
|
}else{
|
67
|
67
|
p1 <- get_ggseqlogo(pwm_mat, method = method, pos_lab = pos_lab)
|
...
|
...
|
@@ -91,13 +91,13 @@ get_ggheatmap <- function(pwm_mat_df){
|
91
|
91
|
ggplot2::theme_bw() +
|
92
|
92
|
ggplot2::xlab(label = element_blank()) +
|
93
|
93
|
ggplot2::scale_fill_gradient2(name = "", low = "white",
|
94
|
|
- mid = "white", high = "#012345") +
|
|
94
|
+ mid = "white", high = "#012345") +
|
95
|
95
|
ggplot2::theme(legend.position = "top",
|
96
|
|
- legend.justification = "center",
|
97
|
|
- legend.margin = margin(0,-1,0,0),
|
98
|
|
- axis.text.x = element_text(size = rel(0.8), angle = 90,
|
99
|
|
- hjust = 1, vjust = 0.5),
|
100
|
|
- plot.margin = margin(0,0,0,0)
|
|
96
|
+ legend.justification = "center",
|
|
97
|
+ legend.margin = margin(0,-1,0,0),
|
|
98
|
+ axis.text.x = element_text(size = rel(0.8), angle = 90,
|
|
99
|
+ hjust = 1, vjust = 0.5),
|
|
100
|
+ plot.margin = margin(0,0,0,0)
|
101
|
101
|
)
|
102
|
102
|
##
|
103
|
103
|
p1
|