... | ... |
@@ -7,7 +7,7 @@ |
7 | 7 |
#' @return tibble (data.frame) object containing CpG islands annotation. |
8 | 8 |
#' |
9 | 9 |
get_cgi <- function(genome) { |
10 |
- available_genomes <- c("hg19", "hg38", "mm10", "grcm39") |
|
10 |
+ available_genomes <- c("hg19", "hg38", "t2t", "mm10", "grcm39") |
|
11 | 11 |
assertthat::assert_that( |
12 | 12 |
genome %in% available_genomes, |
13 | 13 |
msg = sprintf("genome must be one of %s", paste(available_genomes, collapse = ", ")) |
... | ... |
@@ -17,6 +17,7 @@ get_cgi <- function(genome) { |
17 | 17 |
genome, |
18 | 18 |
hg19 = system.file("cgi_hg19.rds", package = "NanoMethViz", mustWork = FALSE), |
19 | 19 |
hg38 = system.file("cgi_hg38.rds", package = "NanoMethViz", mustWork = FALSE), |
20 |
+ t2t = system.file("cgi_t2t.rds", package = "NanoMethViz", mustWork = FALSE), |
|
20 | 21 |
mm10 = system.file("cgi_mm10.rds", package = "NanoMethViz", mustWork = FALSE), |
21 | 22 |
grcm39 = system.file("cgi_GRCm39.rds", package = "NanoMethViz", mustWork = FALSE) |
22 | 23 |
) |
... | ... |
@@ -44,6 +45,16 @@ get_cgi_grcm39 <- function() { |
44 | 45 |
get_cgi("grcm39") |
45 | 46 |
} |
46 | 47 |
|
48 |
+#' @rdname get_exons |
|
49 |
+#' |
|
50 |
+#' @examples |
|
51 |
+#' cgi_t2t <- get_cgi_t2t() |
|
52 |
+#' |
|
53 |
+#'# @export |
|
54 |
+get_cgi_t2t <- function() { |
|
55 |
+ get_cgi("t2t") |
|
56 |
+} |
|
57 |
+ |
|
47 | 58 |
#' @rdname get_exons |
48 | 59 |
#' |
49 | 60 |
#' @examples |
... | ... |
@@ -15,10 +15,10 @@ get_cgi <- function(genome) { |
15 | 15 |
|
16 | 16 |
rds_path <- switch( |
17 | 17 |
genome, |
18 |
- hg19 = system.file("cgi_hg19.rds", package = "NanoMethViz"), |
|
19 |
- hg38 = system.file("cgi_hg38.rds", package = "NanoMethViz"), |
|
20 |
- mm10 = system.file("cgi_mm10.rds", package = "NanoMethViz"), |
|
21 |
- grcm39 = system.file("cgi_GRCm39.rds", package = "NanoMethViz") |
|
18 |
+ hg19 = system.file("cgi_hg19.rds", package = "NanoMethViz", mustWork = FALSE), |
|
19 |
+ hg38 = system.file("cgi_hg38.rds", package = "NanoMethViz", mustWork = FALSE), |
|
20 |
+ mm10 = system.file("cgi_mm10.rds", package = "NanoMethViz", mustWork = FALSE), |
|
21 |
+ grcm39 = system.file("cgi_GRCm39.rds", package = "NanoMethViz", mustWork = FALSE) |
|
22 | 22 |
) |
23 | 23 |
|
24 | 24 |
readRDS(rds_path) |
... | ... |
@@ -2,15 +2,12 @@ |
2 | 2 |
#' |
3 | 3 |
#' Helper functions are provided for obtaining CpG islands annotations from UCSC table browser. |
4 | 4 |
#' |
5 |
-#' @name get_cgi |
|
6 |
-#' @rdname get_cgi |
|
5 |
+#' @keywords internal |
|
7 | 6 |
#' |
8 | 7 |
#' @return tibble (data.frame) object containing CpG islands annotation. |
9 | 8 |
#' |
10 |
-NULL |
|
11 |
- |
|
12 | 9 |
get_cgi <- function(genome) { |
13 |
- available_genomes <- c("hg19", "hg38", "mm10", "GRCm39") |
|
10 |
+ available_genomes <- c("hg19", "hg38", "mm10", "grcm39") |
|
14 | 11 |
assertthat::assert_that( |
15 | 12 |
genome %in% available_genomes, |
16 | 13 |
msg = sprintf("genome must be one of %s", paste(available_genomes, collapse = ", ")) |
... | ... |
@@ -21,7 +18,7 @@ get_cgi <- function(genome) { |
21 | 18 |
hg19 = system.file("cgi_hg19.rds", package = "NanoMethViz"), |
22 | 19 |
hg38 = system.file("cgi_hg38.rds", package = "NanoMethViz"), |
23 | 20 |
mm10 = system.file("cgi_mm10.rds", package = "NanoMethViz"), |
24 |
- GRCm39 = system.file("cgi_GRCm39.rds", package = "NanoMethViz") |
|
21 |
+ grcm39 = system.file("cgi_GRCm39.rds", package = "NanoMethViz") |
|
25 | 22 |
) |
26 | 23 |
|
27 | 24 |
readRDS(rds_path) |
... | ... |
@@ -40,11 +37,11 @@ get_cgi_mm10 <- function() { |
40 | 37 |
#' @rdname get_exons |
41 | 38 |
#' |
42 | 39 |
#' @examples |
43 |
-#' cgi_GRCm39 <- get_cgi_GRCm39() |
|
40 |
+#' cgi_GRCm39 <- get_cgi_grcm39() |
|
44 | 41 |
#' |
45 | 42 |
#' @export |
46 |
-get_cgi_GRCm39 <- function() { |
|
47 |
- get_cgi("GRCm39") |
|
43 |
+get_cgi_grcm39 <- function() { |
|
44 |
+ get_cgi("grcm39") |
|
48 | 45 |
} |
49 | 46 |
|
50 | 47 |
#' @rdname get_exons |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,68 @@ |
1 |
+#' Get CpG islands annotations |
|
2 |
+#' |
|
3 |
+#' Helper functions are provided for obtaining CpG islands annotations from UCSC table browser. |
|
4 |
+#' |
|
5 |
+#' @name get_cgi |
|
6 |
+#' @rdname get_cgi |
|
7 |
+#' |
|
8 |
+#' @return tibble (data.frame) object containing CpG islands annotation. |
|
9 |
+#' |
|
10 |
+NULL |
|
11 |
+ |
|
12 |
+get_cgi <- function(genome) { |
|
13 |
+ available_genomes <- c("hg19", "hg38", "mm10", "GRCm39") |
|
14 |
+ assertthat::assert_that( |
|
15 |
+ genome %in% available_genomes, |
|
16 |
+ msg = sprintf("genome must be one of %s", paste(available_genomes, collapse = ", ")) |
|
17 |
+ ) |
|
18 |
+ |
|
19 |
+ rds_path <- switch( |
|
20 |
+ genome, |
|
21 |
+ hg19 = system.file("cgi_hg19.rds", package = "NanoMethViz"), |
|
22 |
+ hg38 = system.file("cgi_hg38.rds", package = "NanoMethViz"), |
|
23 |
+ mm10 = system.file("cgi_mm10.rds", package = "NanoMethViz"), |
|
24 |
+ GRCm39 = system.file("cgi_GRCm39.rds", package = "NanoMethViz") |
|
25 |
+ ) |
|
26 |
+ |
|
27 |
+ readRDS(rds_path) |
|
28 |
+} |
|
29 |
+ |
|
30 |
+#' @rdname get_exons |
|
31 |
+#' |
|
32 |
+#' @examples |
|
33 |
+#' cgi_mm10 <- get_cgi_mm10() |
|
34 |
+#' |
|
35 |
+#' @export |
|
36 |
+get_cgi_mm10 <- function() { |
|
37 |
+ get_cgi("mm10") |
|
38 |
+} |
|
39 |
+ |
|
40 |
+#' @rdname get_exons |
|
41 |
+#' |
|
42 |
+#' @examples |
|
43 |
+#' cgi_GRCm39 <- get_cgi_GRCm39() |
|
44 |
+#' |
|
45 |
+#' @export |
|
46 |
+get_cgi_GRCm39 <- function() { |
|
47 |
+ get_cgi("GRCm39") |
|
48 |
+} |
|
49 |
+ |
|
50 |
+#' @rdname get_exons |
|
51 |
+#' |
|
52 |
+#' @examples |
|
53 |
+#' cgi_hg19 <- get_cgi_hg19() |
|
54 |
+#' |
|
55 |
+#' @export |
|
56 |
+get_cgi_hg19 <- function() { |
|
57 |
+ get_cgi("hg19") |
|
58 |
+} |
|
59 |
+ |
|
60 |
+#' @rdname get_exons |
|
61 |
+#' |
|
62 |
+#' @examples |
|
63 |
+#' cgi_hg38 <- get_cgi_hg38() |
|
64 |
+#' |
|
65 |
+#' @export |
|
66 |
+get_cgi_hg38 <- function() { |
|
67 |
+ get_cgi("hg38") |
|
68 |
+} |