diff --git a/DESCRIPTION b/DESCRIPTION index 949c4186..3848b98e 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: monaLisa Type: Package Title: Binned Motif Enrichment Analysis and Visualization -Version: 0.99.1 +Version: 0.99.2 Authors@R: c( person("Dania", "Machlab", email = "dania.machlab@fmi.ch", role = c("aut"), comment = c(ORCID = "0000-0002-2578-6930")), diff --git a/R/motif_enrichment_kmers.R b/R/motif_enrichment_kmers.R index 2b33f908..f8e2cd7c 100644 --- a/R/motif_enrichment_kmers.R +++ b/R/motif_enrichment_kmers.R @@ -478,6 +478,7 @@ calcBinnedKmerEnr <- function(seqs, verbose = FALSE) { ## pre-flight checks .assertVector(x = seqs, type = "DNAStringSet") + background <- match.arg(background) if (is.null(bins) && (background %in% c("genome", "model"))) { bins <- factor(rep(1, length(seqs))) } @@ -486,7 +487,6 @@ calcBinnedKmerEnr <- function(seqs, stop("'seqs' and 'bins' must be of equal length and in the same order") } .assertScalar(x = kmerLen, type = "numeric", rngIncl = c(1, Inf)) - background <- match.arg(background) test <- match.arg(test) .assertScalar(x = includeRevComp, type = "logical") .assertScalar(x = pseudocount.kmers, type = "numeric", rngIncl = c(0, Inf)) diff --git a/R/motif_enrichment_monaLisa.R b/R/motif_enrichment_monaLisa.R index 82e392be..01673dd7 100644 --- a/R/motif_enrichment_monaLisa.R +++ b/R/motif_enrichment_monaLisa.R @@ -276,6 +276,7 @@ calcBinnedMotifEnrR <- function(seqs, # checks .assertVector(x = seqs, type = "DNAStringSet") + background <- match.arg(background) if (is.null(bins) && identical(background, "genome")) { bins <- factor(rep(1, length(seqs))) } @@ -284,7 +285,6 @@ calcBinnedMotifEnrR <- function(seqs, stop("'seqs' and 'bins' must be of equal length and in the same order") } .assertVector(x = pwmL, type = "PWMatrixList") - background <- match.arg(background) .assertScalar(x = pseudocount.log2enr, type = "numeric", rngIncl = c(0, Inf)) .assertScalar(x = p.adjust.method, type = "character", diff --git a/vignettes/selecting_motifs_with_randLassoStabSel.Rmd b/vignettes/selecting_motifs_with_randLassoStabSel.Rmd index 7358e48e..13e2205c 100644 --- a/vignettes/selecting_motifs_with_randLassoStabSel.Rmd +++ b/vignettes/selecting_motifs_with_randLassoStabSel.Rmd @@ -30,8 +30,8 @@ margin-right: auto; width: 50%; border: 0" /> # Introduction -Identifying important transcription factor (TF) motifs, as shown in vignette -(reference monaLisa.Rmd), could also be done using a regression based approach, +Identifying important transcription factor (TF) motifs, as shown in +`r Biocpkg("monaLisa", vignette="monaLisa.html", label="the main vignette")`, could also be done using a regression based approach, where motifs are selected and have to compete against each other for selection. In this framework, the response vector can be the observed experimental measure of interest, e.g. log-fold changes of accessibility for a set of regions, and @@ -114,7 +114,7 @@ fraction of G+C and CpG observed/expected ratio as predictors, to ensure that selected TF motifs are not just detecting a simple trend in GC or CpG composition. -```{r predictorMatrix} +```{r predictorMatrix, warning=FALSE} # get PFMs (vertebrate TFs from Jaspar) pfms <- getMatrixSet(JASPAR2020, list(matrixtype = "PFM", tax_group = "vertebrates"))