18
18
# ' annotation = Tmem68$annotation,
19
19
# ' covar = Tmem68$covar,
20
20
# ' qtl.geno = Tmem68$qtl.geno)
21
+ # '
22
+ # ' theme_set(theme_bw())
21
23
# ' kplot(med, symbol.col="symbol")
22
24
# '
23
25
# ' # save the plot as HTML page
24
- # ' pl <- kplot(med, symbol.col="symbol")
26
+ # ' gp <- kplot(med, symbol.col="symbol")
27
+ # ' pl <- ggplotly(gp, tooltip="text")
28
+ # ' pl
25
29
# ' tmpdir <- tempdir()
26
30
# ' htmlwidgets::saveWidget(pl, paste0(tmpdir, "/Tmem68.html"),
27
31
# ' selfcontained=TRUE)
@@ -35,7 +39,7 @@ kplot <- function(med, symbol.col="symbol", chrlen=mouse.chrlen, ...){
35
39
36
40
# Check input
37
41
stopifnot(c(" CHR" , " POS" ," LOD" ) %in% names(med ))
38
-
42
+
39
43
if (! (" GMB" %in% names(med )))
40
44
med $ GMB <- gmb.coordinates(med $ CHR , med $ POS , chrlen = chrlen )
41
45
if (symbol.col %in% names(med )) symbols <- med [,symbol.col ] else symbols <- med [,1 ]
@@ -66,21 +70,20 @@ kplot <- function(med, symbol.col="symbol", chrlen=mouse.chrlen, ...){
66
70
return (sort(gmb.breakpoints ))
67
71
}
68
72
69
- chrs <- c(as.character(1 : 19 ), " X" )
73
+ chrs <- c(as.character(1 : 19 ), " X" , " Y" , " M" )
74
+ chrs <- chrs [chrs %in% unique(med $ CHR )]
70
75
gene.breaks <- get_chr_breaks(med $ CHR , med $ GMB )
71
76
gene.mid <- get_chr_middle_points(med $ CHR , med $ GMB )
72
77
78
+ # to be corrected !!!
73
79
line.style <- theme_bw()$ panel.grid.major
74
- pl <- ggplot(med , aes(x = GMB , y = LOD , color = color , text = SYMBOL )) +
80
+
81
+ ggplot(med , aes(x = GMB , y = LOD , color = color , text = SYMBOL )) +
75
82
geom_point() +
76
83
scale_x_continuous(breaks = gene.mid , labels = chrs , minor_breaks = gene.breaks , expand = c(0 ,0 )) +
77
- theme_bw() +
78
84
theme(legend.position = " none" ) +
79
85
theme(panel.grid.major.x = element_blank()) +
80
86
theme(panel.grid.minor.x = line.style ) +
81
87
xlab(' Position' )
82
-
83
-
84
- ggplotly(pl , tooltip = " text" )
85
88
86
- }
89
+ }
0 commit comments