Skip to content

Commit

Permalink
Update gha and update documentation (#63)
Browse files Browse the repository at this point in the history
* adapt github actions to use new BIOC versions and use always variables

* document arg and fix import warnings

---------

Co-authored-by: Christian Mertes <[email protected]>
  • Loading branch information
ischeller and c-mertes authored Apr 24, 2024
1 parent 71f52c8 commit b17d86d
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 19 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/check-bioc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-${{ runner.bioc }}-r-${{ runner.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-${{ runner.bioc }}-r-${{ runner.r }}-

- name: Cache R packages on Linux
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux' "
uses: actions/cache@v3
with:
path: /home/runner/work/_temp/Library
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-${{ runner.bioc }}-r-${{ runner.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-${{ runner.bioc }}-r-${{ runner.r }}-

- name: Install Linux system dependencies
if: runner.os == 'Linux'
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
rcmdcheck::rcmdcheck(
args = c("--no-manual", "--no-vignettes", "--timings"),
build_args = c("--no-manual", "--keep-empty-dirs", "--no-resave-data"),
error_on = "error",
error_on = "warning",
check_dir = "check"
)
shell: Rscript {0}
Expand Down Expand Up @@ -314,7 +314,7 @@ jobs:
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-biocversion-RELEASE_3_18-r-4.3-results
name: ${{ runner.os }}-biocversion-${{ runner.bioc }}-r-${{ runner.r }}-results
path: check

## Note that DOCKER_PASSWORD is really a token for your dockerhub
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ Suggests:
beeswarm,
covr,
GenomeInfoDb,
ggbio
ggbio,
biovizBase
LinkingTo:
Rcpp,
RcppArmadillo
Expand Down
10 changes: 10 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,22 @@ importFrom(DESeq2,sizeFactors)
importFrom(GenomicFeatures,exonsBy)
importFrom(GenomicFeatures,makeTxDbFromGFF)
importFrom(GenomicRanges,GRanges)
importFrom(GenomicRanges,end)
importFrom(GenomicRanges,findOverlaps)
importFrom(GenomicRanges,reduce)
importFrom(GenomicRanges,start)
importFrom(GenomicRanges,width)
importFrom(IRanges,IRanges)
importFrom(PRROC,pr.curve)
importFrom(RColorBrewer,brewer.pal)
importFrom(S4Vectors,"metadata<-")
importFrom(S4Vectors,"values<-")
importFrom(S4Vectors,DataFrame)
importFrom(S4Vectors,endoapply)
importFrom(S4Vectors,metadata)
importFrom(S4Vectors,queryHits)
importFrom(S4Vectors,subjectHits)
importFrom(S4Vectors,values)
importFrom(SummarizedExperiment,"assay<-")
importFrom(SummarizedExperiment,"assays<-")
importFrom(SummarizedExperiment,"colData<-")
Expand All @@ -123,6 +130,8 @@ importFrom(generics,fit)
importFrom(ggplot2,aes)
importFrom(ggplot2,annotate)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,facet_grid)
importFrom(ggplot2,facet_wrap)
importFrom(ggplot2,geom_abline)
importFrom(ggplot2,geom_bar)
importFrom(ggplot2,geom_histogram)
Expand All @@ -135,6 +144,7 @@ importFrom(ggplot2,geom_vline)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,ggtitle)
importFrom(ggplot2,labs)
importFrom(ggplot2,quo_name)
importFrom(ggplot2,scale_color_brewer)
importFrom(ggplot2,scale_color_identity)
importFrom(ggplot2,scale_color_manual)
Expand Down
21 changes: 13 additions & 8 deletions R/method-plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
#' corrected pvalues were previously computed. Those FDR values
#' on the subset will then be used to determine aberrant status.
#' Default is NULL (using transcriptome-wide FDR corrected pvalues).
#' @param chr The chromosomes to be displayed in the \code{plotManhattan}
#' function. Default is \code{NULL}, i.e. all chromosomes are shown.
#### Graphical parameters
#' @param main Title for the plot, if missing a default title will be used.
#' @param groups A character vector containing either group assignments of
Expand Down Expand Up @@ -1341,8 +1343,8 @@ plotManhattan.OUTRIDER <- function(object, sampleID, value="pvalue",
featureRanges=rowRanges(object),
subsetName=NULL,
chrColor = c("black", "darkgrey")){
require(ggbio)
require(GenomeInfoDb)
requireNamespace("ggbio")
requireNamespace("GenomeInfoDb")

# check user input
checkOutriderDataSet(object)
Expand Down Expand Up @@ -1406,13 +1408,13 @@ plotManhattan.OUTRIDER <- function(object, sampleID, value="pvalue",
if(any(grepl("chr", chr))){
chr <- gsub("chr", "", chr)
}
if(!all(chr %in% unique(seqnames(gr)))){
if(!all(chr %in% unique(GenomeInfoDb::seqnames(gr)))){
stop("Not all chromosomes selected for subsetting are present ",
"in the GRanges object.")
}

# subset
gr <- gr[as.character(seqnames(gr)) %in% chr]
gr <- gr[as.character(GenomeInfoDb::seqnames(gr)) %in% chr]

# add chr to plot title if only one chr given
if(length(chr) == 1){
Expand Down Expand Up @@ -1458,6 +1460,7 @@ plotGrandLinear.adapted <- function (obj, ..., facets, space.skip = 0.01,
highlight.overlap = c("any", "start", "end", "within", "equal"),
spaceline = FALSE,
use.genome.coords=TRUE){
requireNamespace("biovizBase")
if (is.null(geom))
geom <- "point"
args <- list(...)
Expand Down Expand Up @@ -1502,7 +1505,7 @@ plotGrandLinear.adapted <- function (obj, ..., facets, space.skip = 0.01,
if (!is.null(cutoff))
p <- p + geom_hline(yintercept = cutoff, color = cutoff.color,
size = cutoff.size)
chrs <- names(seqlengths(obj))
chrs <- names(GenomeInfoDb::seqlengths(obj))
if (.is.seq) {
N <- length(chrs)
cols <- rep(.color, round(N/length(.color)) + 1)[1:N]
Expand All @@ -1521,7 +1524,7 @@ plotGrandLinear.adapted <- function (obj, ..., facets, space.skip = 0.01,
highlight.overlap <- match.arg(highlight.overlap)
idx <- findOverlaps(obj, highlight.gr, type=highlight.overlap)
.h.pos <- lapply(split(queryHits(idx), subjectHits(idx)), function(id) {
gr <- GRanges(as.character(seqnames(p@data))[id][1],
gr <- GRanges(as.character(GenomeInfoDb::seqnames(p@data))[id][1],
IRanges(start = min(start(p@data[id])),
end = max(end(p@data[id]))))
val <- max(as.numeric(values(p@data[id])[, quo_name(args.aes$y)]))
Expand All @@ -1541,8 +1544,10 @@ plotGrandLinear.adapted <- function (obj, ..., facets, space.skip = 0.01,
do.call(aes, list(x = substitute(midpoint), y = args.aes$y)),
color = highlight.col)
if (!is.null(highlight.name)) {
seqlevels(.h.pos, pruning.mode = "coarse") <- seqlevels(obj)
suppressWarnings(seqinfo(.h.pos) <- seqinfo(obj))
GenomeInfoDb::seqlevels(.h.pos, pruning.mode = "coarse") <-
GenomeInfoDb::seqlevels(obj)
suppressWarnings(GenomeInfoDb::seqinfo(.h.pos) <-
GenomeInfoDb::seqinfo(obj))
.trans <- biovizBase::transformToGenome(.h.pos, space.skip = space.skip)
values(.trans)$mean <- (start(.trans) + end(.trans))/2
values(.trans)$names <- highlight.name
Expand Down
15 changes: 11 additions & 4 deletions R/package-OUTRIDER.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
#'
#' @importFrom GenomicFeatures makeTxDbFromGFF exonsBy
#'
#' @importFrom GenomicRanges GRanges reduce width
#' @importFrom GenomicRanges GRanges reduce width start end findOverlaps
#'
#' @importFrom ggplot2 ggplot aes annotate geom_bar geom_histogram
#' geom_hline geom_smooth geom_point labs scale_x_log10
#' scale_y_log10 scale_fill_manual scale_color_manual
#' scale_fill_brewer scale_color_brewer theme ylim
#' ggtitle geom_vline geom_text scale_linetype_manual geom_line
#' geom_abline theme_bw element_blank xlab ylab scale_color_identity
#' geom_abline theme_bw element_blank xlab ylab scale_color_identity
#' facet_grid facet_wrap quo_name
#'
#' @importFrom ggrepel geom_text_repel
#'
Expand All @@ -62,7 +63,8 @@
#'
#' @importFrom reshape2 melt
#'
#' @importFrom S4Vectors DataFrame metadata metadata<- endoapply
#' @importFrom S4Vectors DataFrame metadata metadata<- endoapply queryHits
#' subjectHits values values<-
#'
#' @importFrom scales math_format trans_format
#'
Expand Down Expand Up @@ -128,5 +130,10 @@ globalVariables(package="OUTRIDER", c(
"Var2",
".x",
"y",
"z"))
"z",
"AberrantByGene",
"AberrantBySample",
"FDR_set",
"aberrantLabel",
"geneID"))

3 changes: 3 additions & 0 deletions man/plotFunctions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b17d86d

Please sign in to comment.