Skip to content

Commit

Permalink
Remove CTSSclusteringMethod and stop recording clustering method name.
Browse files Browse the repository at this point in the history
Storing this information in metadata slots was very fragile, complicated the code, and caused bugs.
  • Loading branch information
Charles Plessy committed May 17, 2024
1 parent 3f85d02 commit 9639a9b
Show file tree
Hide file tree
Showing 29 changed files with 12 additions and 178 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export("inputFilesType<-")
export("sampleLabels<-")
export(CAGEexp)
export(CTSS)
export(CTSSclusteringMethod)
export(CTSScoordinatesGR)
export(CTSScumulativesCC)
export(CTSScumulativesTagClusters)
Expand Down
8 changes: 6 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Upcoming changes in version 2.11.3

BACKWARDS-INCOMPATIBLE CHANGES

- Remove `CTSSclusteringMethod()` function and stop recording clustering
method name.

NEW FEATURES

- New `resetCAGEexp()` function.
Expand Down Expand Up @@ -39,8 +44,7 @@ BUG FIXES

# Changes in version 2.8.0 (25/10/2023)

BACKWARDS-INCOMPATIBLE CHANGES


- The `CTSStagCountDA` function is removed.
- The _dominant peak_ in `TagClusters` objects is now a `GRanges` object like
in `ConsensusClusters`.
Expand Down
3 changes: 1 addition & 2 deletions R/ClusteringMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
#'
#' @author Vanja Haberle
#'
#' @seealso [`tagClustersGR`], [`aggregateTagClusters`] and [`CTSSclusteringMethod`].
#' @seealso [`aggregateTagClusters`]
#'
#' @family CAGEr object modifiers
#' @family CAGEr clusters functions
Expand Down Expand Up @@ -150,7 +150,6 @@ setMethod( "clusterCTSS", "CAGEexp"
stop("Deprecated method. See ", dQuote("CustomConsensusClusters()"), " instead.")
}

CTSSclusteringMethod(ctss.cluster.list) <- method
seqlevels(ctss.cluster.list) <- seqlevels(CTSStagCountSE(object))
seqinfo(ctss.cluster.list) <- seqinfo(CTSStagCountSE(object))
# Changing the sequence levels may change the sort order. Re-sort
Expand Down
42 changes: 2 additions & 40 deletions R/GetMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -384,40 +384,6 @@ setMethod( "CTSSnormalizedTpmGR", "CAGEexp", function (object, samples) {
gr
})

#' @name CTSSclusteringMethod
#'
#' @title Get /set CTSS clustering method
#'
#' @description Returns or sets the name of the method that was used make tag
#' clusters from the CTSSs of a \code{\link{CAGEr}} object.
#'
#' @param object A CAGEr object.
#'
#' @seealso \code{\link{clusterCTSS}}
#' @family CAGEr accessor methods
#' @family CAGEr clusters functions
#'
#' @author Vanja Haberle
#' @author Charles Plessy
#'
#' @examples
#' CTSSclusteringMethod(exampleCAGEexp)
#'
#' @export CTSSclusteringMethod

setGeneric("CTSSclusteringMethod", function(object) standardGeneric("CTSSclusteringMethod"))

#' @rdname CTSSclusteringMethod

setMethod("CTSSclusteringMethod", "GRangesList", function (object)
metadata(object)$clusteringMethod)

#' @rdname CTSSclusteringMethod

setMethod("CTSSclusteringMethod", "CAGEexp", function (object)
CTSSclusteringMethod(metadata(object)$tagClusters))


#' @name tagClustersGR
#' @rdname tagClusters
#'
Expand All @@ -440,14 +406,12 @@ setMethod("CTSSclusteringMethod", "CAGEexp", function (object)
#' start coordinate of the cluster. Used only when
#' `returnInterquantileWidth = TRUE`, otherwise ignored.
#'
#' @return Returns a `GRangesList` or a `GRanges` object with genomic coordinates,
#' @return Returns a `GRangesList` or a `TagClusters` object with genomic coordinates,
#' position of dominant TSS, total CAGE signal and additional information for
#' all TCs from specified CAGE dataset (sample). If
#' `returnInterquantileWidth = TRUE`, interquantile width for each TC is also
#' calculated using provided quantile positions. The [`S4Vectors::metadata`]
#' slot of the object contains a copy of the `CAGEexp` object's _column data_,
#' as well as information on the clustering method in a `clusteringMethod`
#' element.
#' slot of the object contains a copy of the `CAGEexp` object's _column data_.
#'
#' @author Vanja Haberle
#' @author Charles Plessy
Expand All @@ -460,7 +424,6 @@ setMethod("CTSSclusteringMethod", "CAGEexp", function (object)
#' tagClustersGR( exampleCAGEexp, "Zf.high", TRUE, 0.1, 0.9 )
#' tagClustersGR( exampleCAGEexp, 1
#' , returnInterquantileWidth = TRUE, qLow = 0.1, qUp = 0.9 )
#' tagClustersGR( exampleCAGEexp )$clusteringMethod
#' tagClustersGR( exampleCAGEexp )@metadata$colData
#'
#' @export
Expand All @@ -475,7 +438,6 @@ setGeneric( "tagClustersGR"
, returnInterquantileWidth = returnInterquantileWidth
, qLow = qLow, qUp = qUp))
names(tc.list) <- sampleLabels(object)
metadata(tc.list)$clusteringMethod <- CTSSclusteringMethod(object)
metadata(tc.list)$colData <- colData(object)
return(tc.list)
}
Expand Down
27 changes: 0 additions & 27 deletions R/SetMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,33 +159,6 @@ setMethod("filteredCTSSidx<-", "CAGEexp", function (object, value) {
if (validObject(object)) object
})


#' @name CTSSclusteringMethod<-
#'
#' @rdname CTSSclusteringMethod
#'
#' @param value character

setGeneric( "CTSSclusteringMethod<-"
, function(object, value) standardGeneric("CTSSclusteringMethod<-"))

#' @rdname CTSSclusteringMethod

setMethod("CTSSclusteringMethod<-", "GRangesList", function (object, value) {
metadata(object)$clusteringMethod <- value
if (validObject(object)) object
})

#' @rdname CTSSclusteringMethod

setMethod("CTSSclusteringMethod<-", "CAGEexp", function (object, value) {
CTSSclusteringMethod(metadata(object)$tagClusters) <- value
# extrat directly TCs from metadata slot because tagClustersGR does more that
# is not needed here.
if (validObject(object)) object
})


#' @name CTSScumulativesTagClusters<-
#'
#' @rdname CTSScumulativesTagClusters
Expand Down
Binary file modified data/exampleCAGEexp.RData
Binary file not shown.
75 changes: 0 additions & 75 deletions man/CTSSclusteringMethod.Rd

This file was deleted.

1 change: 0 additions & 1 deletion man/CTSScoordinates.Rd

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

2 changes: 0 additions & 2 deletions man/CTSScumulativesTagClusters.Rd

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

1 change: 0 additions & 1 deletion man/CTSSnormalizedTpm.Rd

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

1 change: 0 additions & 1 deletion man/CTSStagCount.Rd

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

1 change: 0 additions & 1 deletion man/CustomConsensusClusters.Rd

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

1 change: 0 additions & 1 deletion man/GeneExpDESeq2.Rd

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

1 change: 0 additions & 1 deletion man/GeneExpSE.Rd

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

1 change: 0 additions & 1 deletion man/aggregateTagClusters.Rd

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

3 changes: 1 addition & 2 deletions man/clusterCTSS.Rd

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

2 changes: 0 additions & 2 deletions man/consensusClusters.Rd

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

1 change: 0 additions & 1 deletion man/consensusClustersDESeq2.Rd

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

1 change: 0 additions & 1 deletion man/cumulativeCTSSdistribution.Rd

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

1 change: 0 additions & 1 deletion man/expressionClasses.Rd

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

1 change: 0 additions & 1 deletion man/genomeName.Rd

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

1 change: 0 additions & 1 deletion man/inputFiles.Rd

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

1 change: 0 additions & 1 deletion man/inputFilesType.Rd

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

1 change: 0 additions & 1 deletion man/librarySizes.Rd

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

1 change: 0 additions & 1 deletion man/plotInterquantileWidth.Rd

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

Loading

0 comments on commit 9639a9b

Please sign in to comment.