Skip to content

Commit

Permalink
rename to removeClusters
Browse files Browse the repository at this point in the history
  • Loading branch information
epurdom committed Feb 14, 2018
1 parent e0da721 commit a836e11
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 38 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Expand Up @@ -84,6 +84,7 @@ exportMethods(primaryCluster)
exportMethods(primaryClusterIndex)
exportMethods(primaryClusterNamed)
exportMethods(removeClusterings)
exportMethods(removeClusters)
exportMethods(removeUnclustered)
exportMethods(requiredArgs)
exportMethods(setToCurrent)
Expand All @@ -93,7 +94,6 @@ exportMethods(subsampleClustering)
exportMethods(tableClusters)
exportMethods(transformData)
exportMethods(transformation)
exportMethods(unassignSamples)
exportMethods(workflowClusterDetails)
exportMethods(workflowClusterTable)
exportMethods(workflowClusters)
Expand Down
43 changes: 19 additions & 24 deletions NEWS
Expand Up @@ -2,10 +2,10 @@ Changes in version 1.5.0-9012 ( Release date: )
==============

Changes:
* This version consists of a major update of how dimensionality reduction and filtering is done. The class has been updated to extend the new `SingleCellExperiment` class, which save the dimensionality reductions. Furthermore we extend that class to also save filtering statistics (`SingleCellFilter`). This has created a massive change under-the-hood in functions that allow dimensionality reduction and filtering. Changes to function names:
* MAJOR CHANGE TO DEFINITION OF CLASS: This version consists of a major update of how dimensionality reduction and filtering is done. The class has been updated to extend the new `SingleCellExperiment` class, which save the dimensionality reductions. Furthermore, calculating of per-gene statistics, which are usually used for filtering, are stored in `colData` of the object and can be easily accessed and used for repeated filtering without recalculating. This has created a massive change under-the-hood in functions that allow dimensionality reduction and filtering. Changes to function names are the following:
- `transform` is now `transformData`
- New functions `makeReducedDims` and `makeFilterStats` will calculate (and thus store) dimensionality reductions and statistics for filtering the data.
- New function `filterData` will return a `SingleCellFilter` object with the data filtered based on a filtering criteria
- New function `filterData` will return the filtered data as a matrix
- New functions `listBuiltInReducedDims` and `listBuiltInFilterStats` give the list of currently available functions for dimensionality reduction and filtering statistics, respectively.
- Filtering on arbitrary statistics and user-defined dimensionality reduction can used in `clusterMany` and related functions, so long as they are saved in the appropriate slots of the object.
* Changed the following functions/arguments to be consistent with SingleCellExperiment naming conventions and improve distinction between terminology of cluster and clustering.
Expand All @@ -16,14 +16,24 @@ Changes:
- `ndims` to `nDims` in `clusterSingle` and `makeDendrogram` to keep consistency.
- `plotDimReduce` to `plotReducedDims`
- Changed `nClusters` to `nClusterings` to better indicate purpose of function. `nClusters` now gives the number of clusters per clustering.
- `addClusters` to `addClusterings` and `removeClusters` to `removeClusterings`.
- `addClusters` to `addClusterings` and `removeClusters` to `removeClusterings`. New function `removeClusters` allows the user to actually ``remove" a cluster or clusters from a clustering by assigning samples in those clusters to `-1` value.
- `clusterInfo()` to `clusteringInfo()`
* `getClusterManyParams` now uses saved `clusterInfo` rather than `clusterLabels` to get parameters. The resulting output is formatted somewhat differently.
* removed `transformation` as a required argument to `ClusterExperiment`. Now sets with default of `function(x){x}`.
* Adjusted color definitions of `seqPal2` and `seqPal4` to be completely symmetric.
* Argument `existingColors` in `plotClustersWorkflow` now takes arguments `ignore`,`all`,`highlightOnly` similar to `plotClusters`
* Argumnet `nodeColors` now available in `plotDendrogram`
* Argument `contrastColors` now available in plotContrastHeatmap. Genes are now ordered by fold-change within each contrast.
* In addition these structural changes, the following updates are also included in this release
- `getClusterManyParams` now uses saved `clusterInfo` rather than `clusterLabels` to get parameters. The resulting output is formatted somewhat differently.
- removed `transformation` as a required argument to `ClusterExperiment`. Now sets with default of `function(x){x}`.
- Adjusted color definitions of `seqPal2` and `seqPal4` to be completely symmetric around center.
- Argument `existingColors` in `plotClustersWorkflow` now takes arguments `ignore`,`all`,`highlightOnly` similar to `plotClusters`
- Argumnet `nodeColors` now available in `plotDendrogram`
- Argument `contrastColors` now available in plotContrastHeatmap. Genes are now ordered by fold-change within each contrast.
- New function `plotClusterLegend` that will plot a legend for a clustering.
- `plotClusters` argument `existingColors` now allows for the option `firstOnly`
- makeDendrogram now allows option 'coCluster' to the argument `dimReduce` indicating use of the coClustering matrix to build the dendrogram.
- makeDendrogram now has a method for building a dendrogram from an arbitrary distance function
- `showBigPalette` has been replaced with `showPalette` and now can show any palette of colors.
- Changed defaults in `plotDendrogram` so default is to do colorblock of samples.
- The colors in `bigPalette` have been changed and shuffled to reduce similar colors and `massivePalette` has been created by adding the non-grey colors from `colors()` so that `plotClusters` will not run out of colors.
- `clusterMatrix` function now returns cluster matrix with rownames corresponding to sample names.
- `convertClusterLegend` now takes argument `whichClusters`

Bugs:
* converted automatic assignment of colors in `clusterLegend` to be based on `massivePalette` so won't run out on toy examples.
Expand All @@ -32,21 +42,6 @@ Bugs:
- will plot annotation labels when there is `NA` in the annotation
- no longer calls internal function `NMF:::vplayout` in making those labels, more robust
* fixed bug in how `plotClustersWorkflow` handled existing colors.

Changes in version 1.5.0-9002 ( Release date: )
==============
Changes:
* New function `plotClusterLegend` that will plot a legend for a clustering.
* `plotClusters` argument `existingColors` now allows for the option `firstOnly`
* makeDendrogram now allows option 'coCluster' to the argument `dimReduce` indicating use of the coClustering matrix to build the dendrogram.
* makeDendrogram now has a method for building a dendrogram from an arbitrary distance function
* `showBigPalette` has been replaced with `showPalette` and now can show any palette of colors.
* Changed defaults in `plotDendrogram` so is colorblock of samples.
* The colors in `bigPalette` have been changed and shuffled to reduce similar colors and `massivePalette` has been created by adding the non-grey colors from `colors()` so that `plotClusters` will not run out of colors.
* `clusterMatrix` function now returns cluster matrix with rownames corresponding to sample names.
* `convertClusterLegend` now takes argument `whichClusters`

Bugs:
* Fixed so `diss` now passed to subsampling in calls to clusterSingle/clusterMany
* Fixed so `plotClusters` now will not give incomprehensible error if given duplicates of a color
* Fixed `plotDendrogram` so will not create blank plot.
Expand Down
4 changes: 2 additions & 2 deletions R/AllGenerics.R
Expand Up @@ -320,8 +320,8 @@ setGeneric(
)


setGeneric( name = "unassignSamples", def = function(x, whichClusters,...) {
standardGeneric("unassignSamples")})
setGeneric( name = "removeClusters", def = function(x, whichClusters,...) {
standardGeneric("removeClusters")})
setGeneric( name = "addClusterings", def = function(x, y,...) {
standardGeneric("addClusterings")})
setGeneric(name = "removeClusterings", def = function(x, whichClusters,...) {
Expand Down
10 changes: 5 additions & 5 deletions R/addClusters.R
Expand Up @@ -166,13 +166,13 @@ setMethod(
)


#' @details \code{unassignSamples} unassigns samples in \code{clustersToRemove} and assigns them to -1 (unassigned)
#' @details \code{removeClusters} unassigns samples in \code{clustersToRemove} and assigns them to -1 (unassigned)
#' @param clustersToRemove numeric vector identifying the clusters to remove (whose samples will be reassigned to -1 value).
#' @rdname addClusterings
#' @aliases unassignSamples
#' @aliases removeClusters
#' @export
setMethod(
f = "unassignSamples",
f = "removeClusters",
signature = c("ClusterExperiment","numeric"),
definition = function(x,whichClusters,clustersToRemove) {
if(length(whichClusters)!=1) stop("whichClusters should identify a single clustering.")
Expand All @@ -190,10 +190,10 @@ setMethod(
#' @rdname addClusterings
#' @export
setMethod(
f = "unassignSamples",
f = "removeClusters",
signature = signature("ClusterExperiment","character"),
definition = function(x, whichClusters,...) {
whichClusters<-.TypeIntoIndices(x,whichClusters)
unassignSamples(x,whichClusters,...)
removeClusters(x,whichClusters,...)
}
)
12 changes: 6 additions & 6 deletions man/addClusterings.Rd

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

0 comments on commit a836e11

Please sign in to comment.