Skip to content

Commit 2d3c730

Browse files
author
Charles Plessy
committed
Remove obsolete and broken customClusters methods.
Closes #113
1 parent 93d2fb1 commit 2d3c730

File tree

3 files changed

+21
-35
lines changed

3 files changed

+21
-35
lines changed

NEWS.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
# Changes in version 2.8.0
1+
# Changes in version 2.11.1
2+
3+
BUG FIXES
4+
5+
- Remove broken and obsolete `customClusters` method of `clusterCTSS`. Use
6+
`CustomConsensusClusters()` instead.
7+
8+
# Changes in version 2.8.0 (25/10/2023)
29

310
BUG FIXES
411

R/ClusteringMethods.R

+8-20
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,21 @@
1616
#' @param thresholdIsTpm Logical indicating if `threshold` is expressed in
1717
#' raw tag counts (`FALSE`) or normalized signal (`TRUE`).
1818
#'
19-
#' @param method Method to be used for clustering: `"distclu"`,
20-
#' `"paraclu"` or `"custom"`. See Details.
19+
#' @param method Method to be used for clustering: `"distclu"` or `"paraclu"`.
20+
#' See Details.
2121
#'
2222
#' @param maxDist Maximal distance between two neighbouring CTSSs for them to be
2323
#' part of the same cluster. Used only when `method = "distclu"`,
2424
#' otherwise ignored.
2525
#'
2626
#' @param removeSingletons Logical indicating if tag clusters containing only
27-
#' one CTSS be removed. Ignored when `method = "custom"`.
27+
#' one CTSS be removed.
2828
#'
2929
#' @param keepSingletonsAbove Controls which singleton tag clusters will be
3030
#' removed. When `removeSingletons = TRUE`, only singletons with signal
3131
#' `< keepSingletonsAbove` will be removed. Useful to prevent removing
3232
#' highly supported singleton tag clusters. Default value `Inf` results
33-
#' in removing all singleton TCs when `removeSingletons = TRUE`. Ignored
34-
#' when `method = "custom"`.
33+
#' in removing all singleton TCs when `removeSingletons = TRUE`.
3534
#'
3635
#' @param minStability Minimal stability of the cluster, where stability is
3736
#' defined as ratio between maximal and minimal density value for which
@@ -40,18 +39,12 @@
4039
#' `< minStability` will be discarded. Used only when `method = "paraclu"`.
4140
#'
4241
#' @param maxLength Maximal length of cluster in base-pairs. Clusters with length
43-
#' `> maxLength` will be discarded. Ignored when `method = "custom"`.
42+
#' `> maxLength` will be discarded.
4443
#'
4544
#' @param reduceToNonoverlapping Logical, should smaller clusters contained
4645
#' within bigger cluster be removed to make a final set of tag clusters
4746
#' non-overlapping. Used only `method = "paraclu"`.
4847
#'
49-
#' @param customClusters Genomic coordinates of predefined regions to be used to
50-
#' segment the CTSSs. The format is either a [`GRanges`] object or a
51-
#' [`data.frame`] with the following columns: `chr` (chromosome name),
52-
#' `start` (0-based start coordinate), `end` (end coordinate), `strand`
53-
#' (either `"+"`, or `"-"`). Used only when `method = "custom"`.
54-
#'
5548
#' @param useMulticore Logical, should multicore be used. `useMulticore = TRUE`
5649
#' has no effect on non-Unix-like platforms.
5750
#'
@@ -116,7 +109,7 @@ setGeneric( "clusterCTSS"
116109
, method = c("distclu", "paraclu", "custom"), maxDist = 20
117110
, removeSingletons = FALSE, keepSingletonsAbove = Inf
118111
, minStability = 1, maxLength = 500
119-
, reduceToNonoverlapping = TRUE, customClusters = NULL
112+
, reduceToNonoverlapping = TRUE
120113
, useMulticore = FALSE, nrCores = NULL)
121114
standardGeneric("clusterCTSS"))
122115

@@ -125,7 +118,7 @@ setGeneric( "clusterCTSS"
125118
setMethod( "clusterCTSS", "CAGEexp"
126119
, function( object, threshold, nrPassThreshold, thresholdIsTpm, method, maxDist
127120
, removeSingletons, keepSingletonsAbove, minStability, maxLength
128-
, reduceToNonoverlapping, customClusters, useMulticore, nrCores) {
121+
, reduceToNonoverlapping, useMulticore, nrCores) {
129122

130123
assay <- ifelse(isTRUE(thresholdIsTpm), "normalizedTpmMatrix", "counts")
131124
data <- CTSStagCountSE(object)
@@ -156,12 +149,7 @@ setMethod( "clusterCTSS", "CAGEexp"
156149
, reduceToNonoverlapping = reduceToNonoverlapping
157150
, useMulticore = useMulticore, nrCores = nrCores)
158151
} else if(method == "custom") {
159-
if(is.null(customClusters))
160-
stop(sQuote("customClusters"), " must be given when method = ", sQuote("custom"), ".")
161-
ctss.cluster.list <- .predefined.clusters( data = data[decode(filteredCTSSidx(object)),]
162-
, sample.labels = sampleLabels(object)
163-
, custom.clusters = customClusters
164-
, useMulticore = useMulticore, nrCores = nrCores)
152+
stop("Deprecated method. See ", dQuote("CustomConsensusClusters()"), " instead.")
165153
}
166154

167155
CTSSclusteringMethod(ctss.cluster.list) <- method

man/clusterCTSS.Rd

+5-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)