diff --git a/DESCRIPTION b/DESCRIPTION index 21e138e..a04a3fa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: CAGEr Title: Analysis of CAGE (Cap Analysis of Gene Expression) sequencing data for precise mapping of transcription start sites and promoterome mining -Version: 2.11.3 -Date: 2024-05-24 +Version: 2.11.4 +Date: 2024-08-02 Authors@R: c( person("Vanja", "Haberle", email = "vanja.haberle@gmail.com", role = "aut"), person("Charles", "Plessy", email = "charles.plessy@oist.jp", role = "cre"), diff --git a/NAMESPACE b/NAMESPACE index d835e37..1e9f865 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -40,6 +40,7 @@ export(distclu) export(exportToTrack) export(expressionClasses) export(filterLowExpCTSS) +export(filteredCTSSidx) export(findStrandInvaders) export(flagByUpstreamSequences) export(flagLowExpCTSS) diff --git a/NEWS.md b/NEWS.md index 600c000..b675b95 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# Upcoming changes in version 2.11.4 +# Changes in version 2.11.4 BACKWARDS-INCOMPATIBLE CHANGES @@ -8,6 +8,11 @@ NEW FEATURES - Support the use of `TxDB` objects for annotating clusters. +BUG FIXES + +- Fix issue #120 introduced in 2.11.3, where clustering functions would + fail if `filterLowExpCTSS` was not run before. + # Changes in version 2.11.3 BACKWARDS-INCOMPATIBLE CHANGES diff --git a/R/CAGEr.R b/R/CAGEr.R index f914572..388913b 100644 --- a/R/CAGEr.R +++ b/R/CAGEr.R @@ -182,6 +182,8 @@ setMethod("validSamples", "CAGEr", function (object, x){ #' #' @export #' +#' @family CAGEr filter functions +#' #' @examples #' flagLowExpCTSS(exampleCAGEexp, threshold = 100, nrPassThreshold = 2) diff --git a/R/GetMethods.R b/R/GetMethods.R index c00b832..c7c78a5 100644 --- a/R/GetMethods.R +++ b/R/GetMethods.R @@ -454,13 +454,32 @@ setMethod( "tagClustersGR", "CAGEexp" .TagClusters(tc) }) -#' @name filteredCTSSidx -#' @noRd +#' The `filteredCTSSidx()` function is in _CAGEr_ functions to retrieve the +#' result of the `flagLowExpCTSS()` function in a safe way. +#' +#' @returns Returns the value of `filteredCTSSidx` in the row ranges of the +#' tag count matrix experiment of the `CAGEexp` object, or `Rle(TRUE)` if it +#' was `NULL` +#' +#' @param object A [`CAGEexp`] object +#' +#' @export +#' +#' @examples +#' +#' filteredCTSSidx(exampleCAGEexp) +#' +#' @family CAGEr filter functions +#' @family CAGEr accessor methods setGeneric("filteredCTSSidx", function(object) standardGeneric("filteredCTSSidx")) +#' @rdname filteredCTSSidx + setMethod("filteredCTSSidx", "CAGEexp", function (object){ - rowData(CTSStagCountSE(object))$filteredCTSSidx + res <- rowData(CTSStagCountSE(object))$filteredCTSSidx + if (is.null(res)) return(Rle(TRUE)) + res }) diff --git a/man/CTSScoordinates.Rd b/man/CTSScoordinates.Rd index 2d2710d..ce3cea7 100644 --- a/man/CTSScoordinates.Rd +++ b/man/CTSScoordinates.Rd @@ -52,6 +52,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/CTSScumulativesTagClusters.Rd b/man/CTSScumulativesTagClusters.Rd index f54b4c0..1894baf 100644 --- a/man/CTSScumulativesTagClusters.Rd +++ b/man/CTSScumulativesTagClusters.Rd @@ -55,6 +55,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/CTSSnormalizedTpm.Rd b/man/CTSSnormalizedTpm.Rd index 6da6318..392b1f8 100644 --- a/man/CTSSnormalizedTpm.Rd +++ b/man/CTSSnormalizedTpm.Rd @@ -46,6 +46,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/CTSStagCount.Rd b/man/CTSStagCount.Rd index 8d16071..1718d0e 100644 --- a/man/CTSStagCount.Rd +++ b/man/CTSStagCount.Rd @@ -63,6 +63,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/GeneExpDESeq2.Rd b/man/GeneExpDESeq2.Rd index a31e2fd..0c59f4f 100644 --- a/man/GeneExpDESeq2.Rd +++ b/man/GeneExpDESeq2.Rd @@ -40,6 +40,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/GeneExpSE.Rd b/man/GeneExpSE.Rd index 5445e1b..7ad4176 100644 --- a/man/GeneExpSE.Rd +++ b/man/GeneExpSE.Rd @@ -30,6 +30,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpDESeq2}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/consensusClusters.Rd b/man/consensusClusters.Rd index 0e920be..1cb0bc6 100644 --- a/man/consensusClusters.Rd +++ b/man/consensusClusters.Rd @@ -60,6 +60,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpDESeq2}()}, \code{\link{GeneExpSE}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/expressionClasses.Rd b/man/expressionClasses.Rd index ef0aaf4..4f3774d 100644 --- a/man/expressionClasses.Rd +++ b/man/expressionClasses.Rd @@ -42,6 +42,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpDESeq2}()}, \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/filteredCTSSidx.Rd b/man/filteredCTSSidx.Rd new file mode 100644 index 0000000..e9ac091 --- /dev/null +++ b/man/filteredCTSSidx.Rd @@ -0,0 +1,53 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/GetMethods.R +\name{filteredCTSSidx} +\alias{filteredCTSSidx} +\alias{filteredCTSSidx,CAGEexp-method} +\title{The \code{filteredCTSSidx()} function is in \emph{CAGEr} functions to retrieve the +result of the \code{flagLowExpCTSS()} function in a safe way.} +\usage{ +filteredCTSSidx(object) + +\S4method{filteredCTSSidx}{CAGEexp}(object) +} +\arguments{ +\item{object}{A \code{\link{CAGEexp}} object} +} +\value{ +Returns the value of \code{filteredCTSSidx} in the row ranges of the +tag count matrix experiment of the \code{CAGEexp} object, or \code{Rle(TRUE)} if it +was \code{NULL} +} +\description{ +The \code{filteredCTSSidx()} function is in \emph{CAGEr} functions to retrieve the +result of the \code{flagLowExpCTSS()} function in a safe way. +} +\examples{ + +filteredCTSSidx(exampleCAGEexp) + +} +\seealso{ +Other CAGEr filter functions: +\code{\link{flagByUpstreamSequences}()}, +\code{\link{flagLowExpCTSS}()} + +Other CAGEr accessor methods: +\code{\link{CTSScoordinatesGR}()}, +\code{\link{CTSScumulativesTagClusters}()}, +\code{\link{CTSSnormalizedTpmDF}()}, +\code{\link{CTSStagCountDF}()}, +\code{\link{GeneExpDESeq2}()}, +\code{\link{GeneExpSE}()}, +\code{\link{consensusClustersGR}()}, +\code{\link{expressionClasses}()}, +\code{\link{genomeName}()}, +\code{\link{inputFiles}()}, +\code{\link{inputFilesType}()}, +\code{\link{librarySizes}()}, +\code{\link{sampleLabels}()}, +\code{\link{seqNameTotalsSE}()}, +\code{\link{tagClustersGR}()} +} +\concept{CAGEr accessor methods} +\concept{CAGEr filter functions} diff --git a/man/flagByUpstreamSequences.Rd b/man/flagByUpstreamSequences.Rd index f7d7f20..b5d6ac3 100644 --- a/man/flagByUpstreamSequences.Rd +++ b/man/flagByUpstreamSequences.Rd @@ -40,6 +40,11 @@ If the provided \code{object} represents \emph{tag clusters} or \emph{consensus the search will be done upstream its \emph{dominant peak}. Convert the object to the \code{GRanges} class if this is not the behaviour you want. } +\seealso{ +Other CAGEr filter functions: +\code{\link{filteredCTSSidx}()}, +\code{\link{flagLowExpCTSS}()} +} \author{ Charles Plessy } diff --git a/man/flagLowExpCTSS.Rd b/man/flagLowExpCTSS.Rd index 701a31e..797d69c 100644 --- a/man/flagLowExpCTSS.Rd +++ b/man/flagLowExpCTSS.Rd @@ -87,3 +87,9 @@ reproduced. \examples{ flagLowExpCTSS(exampleCAGEexp, threshold = 100, nrPassThreshold = 2) } +\seealso{ +Other CAGEr filter functions: +\code{\link{filteredCTSSidx}()}, +\code{\link{flagByUpstreamSequences}()} +} +\concept{CAGEr filter functions} diff --git a/man/genomeName.Rd b/man/genomeName.Rd index cbce7fd..61dc26c 100644 --- a/man/genomeName.Rd +++ b/man/genomeName.Rd @@ -52,6 +52,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, \code{\link{librarySizes}()}, diff --git a/man/inputFiles.Rd b/man/inputFiles.Rd index 1d3bb88..4f52f6d 100644 --- a/man/inputFiles.Rd +++ b/man/inputFiles.Rd @@ -41,6 +41,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFilesType}()}, \code{\link{librarySizes}()}, diff --git a/man/inputFilesType.Rd b/man/inputFilesType.Rd index acc4494..6cf8b35 100644 --- a/man/inputFilesType.Rd +++ b/man/inputFilesType.Rd @@ -75,6 +75,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{librarySizes}()}, diff --git a/man/librarySizes.Rd b/man/librarySizes.Rd index 6a7711a..7689aa6 100644 --- a/man/librarySizes.Rd +++ b/man/librarySizes.Rd @@ -41,6 +41,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/sampleLabels.Rd b/man/sampleLabels.Rd index 5b35997..ba59b5f 100644 --- a/man/sampleLabels.Rd +++ b/man/sampleLabels.Rd @@ -78,6 +78,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/seqNameTotalsSE.Rd b/man/seqNameTotalsSE.Rd index b0eb9de..84c3207 100644 --- a/man/seqNameTotalsSE.Rd +++ b/man/seqNameTotalsSE.Rd @@ -39,6 +39,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()}, diff --git a/man/tagClusters.Rd b/man/tagClusters.Rd index 3046e32..93f7612 100644 --- a/man/tagClusters.Rd +++ b/man/tagClusters.Rd @@ -60,6 +60,7 @@ Other CAGEr accessor methods: \code{\link{GeneExpSE}()}, \code{\link{consensusClustersGR}()}, \code{\link{expressionClasses}()}, +\code{\link{filteredCTSSidx}()}, \code{\link{genomeName}()}, \code{\link{inputFiles}()}, \code{\link{inputFilesType}()},