diff --git a/NAMESPACE b/NAMESPACE index 2f9d2ac..ea95618 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -131,7 +131,13 @@ importFrom(methods,extends) importFrom(patchwork,wrap_plots) importFrom(rlang,.data) importFrom(rlang,as_label) +importFrom(rtracklayer,GRangesForUCSCGenome) +importFrom(rtracklayer,browserSession) +importFrom(rtracklayer,getTable) importFrom(rtracklayer,import) +importFrom(rtracklayer,tableName) +importFrom(rtracklayer,ucscGenomes) +importFrom(rtracklayer,ucscTableQuery) importFrom(scales,comma) importFrom(scales,rescale) importFrom(scales,scientific) diff --git a/R/geom_ideogram.R b/R/geom_ideogram.R index 6b86f23..fa4cd90 100644 --- a/R/geom_ideogram.R +++ b/R/geom_ideogram.R @@ -21,18 +21,21 @@ #' #' @return Plot. #' @importFrom dplyr %>% -#' @importFrom GenomicRanges GRanges makeGRangesFromDataFrame +#' @importFrom GenomicRanges GRanges makeGRangesFromDataFrame trim #' @importFrom IRanges IRanges subsetByOverlaps -#' @importFrom ggplot2 ggplot_add ggplot geom_rect aes_string geom_polygon theme_classic theme element_blank -#' scale_x_continuous scale_y_continuous margin +#' @importFrom ggplot2 ggplot_add ggplot geom_rect aes_string geom_polygon +#' theme_classic theme element_blank scale_x_continuous scale_y_continuous +#' margin #' @importFrom patchwork wrap_plots #' @importFrom methods extends #' @importFrom utils menu +#' @importFrom rtracklayer ucscGenomes ucscTableQuery tableName getTable +#' GRangesForUCSCGenome browserSession #' @importFrom GenomeInfoDb seqlengths seqlengths<- seqnames -#' @importFrom GenomicRanges trim GRanges #' @export #' #' @examples +#' \dontrun{ #' library(ggbio) #' #' # load metadata @@ -68,6 +71,7 @@ #' basic_coverage + #' geom_gene(gtf.gr = gtf_gr) + #' geom_ideogram(genome = "hg19", plot.space = 0) +#' } #' geom_ideogram <- function(genome = "hg19", mark.color = "red", mark.alpha = 0.7, mark.line.size = 1, add.shadow = TRUE, shadow.color = "grey", shadow.alpha = 0.7, shadow.line.size = 1, diff --git a/R/utils.R b/R/utils.R index 92499ae..696a618 100644 --- a/R/utils.R +++ b/R/utils.R @@ -275,7 +275,7 @@ getIdeogram <- function(genome, subchr = NULL, cytobands = TRUE) { suppressWarnings(GenomeInfoDb::seqlengths(gr) <- new.seqlength) gr <- GenomicRanges::trim(gr) } else { - message("cytoBand informatin is not available, only get ranges.") + message("cytoBand information is not available, only getting ranges.") message("Loading ranges...") gr <- rtracklayer::GRangesForUCSCGenome(genome) message("Done") diff --git a/man/geom_ideogram.Rd b/man/geom_ideogram.Rd index 1b228e8..b176919 100644 --- a/man/geom_ideogram.Rd +++ b/man/geom_ideogram.Rd @@ -67,6 +67,7 @@ Plot. Add Ideogram Annotation to Coverage Plot. } \examples{ +\dontrun{ library(ggbio) # load metadata @@ -102,5 +103,6 @@ basic_coverage <- ggcoverage( basic_coverage + geom_gene(gtf.gr = gtf_gr) + geom_ideogram(genome = "hg19", plot.space = 0) +} }