Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Depends:
mia
Imports:
dplyr,
ggplot2,
glmnet,
methods,
S4Vectors,
Expand All @@ -39,7 +40,6 @@ Imports:
Suggests:
BiocStyle,
devtools,
ggplot2,
knitr,
lubridate,
miaViz,
Expand Down
18 changes: 17 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Generated by roxygen2: do not edit by hand

S3method(plot,miatime_cox)
export(addBaselineDivergence)
export(addBimodality)
export(addCox)
export(addRankShift)
export(addShortTermChange)
export(addStability)
export(addStepwiseDivergence)
export(addSurvival)
export(getBaselineDivergence)
export(getBimodality)
export(getCox)
export(getRankShift)
export(getSamplingSummary)
export(getShortTermChange)
Expand All @@ -17,13 +20,15 @@ export(getStepwiseDivergence)
export(getSurvival)
exportMethods(addBaselineDivergence)
exportMethods(addBimodality)
exportMethods(addCox)
exportMethods(addRankShift)
exportMethods(addShortTermChange)
exportMethods(addStability)
exportMethods(addStepwiseDivergence)
exportMethods(addSurvival)
exportMethods(getBaselineDivergence)
exportMethods(getBimodality)
exportMethods(getCox)
exportMethods(getRankShift)
exportMethods(getSamplingSummary)
exportMethods(getShortTermChange)
Expand Down Expand Up @@ -56,6 +61,16 @@ importFrom(dplyr,
ungroup,
vars
)
importFrom(ggplot2,
.data,
aes,
geom_point,
geom_segment,
geom_step,
ggplot,
labs,
theme_minimal
)
importFrom(glmnet,
Cindex,
cv.glmnet,
Expand All @@ -70,7 +85,8 @@ importFrom(stats,
)
importFrom(survival,
Surv,
coxph
coxph,
survfit
)
importFrom(tidyr,
pivot_wider,
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Changes in version 1.5.x
+ getCox and addCox replace getSurvival and addSurvival, which are deprecated; nvar is now max.features
+ getCox results have a plot() method for the coefficients and for the survival curves of high and low risk samples
+ getCox: max.features (nvar in getSurvival) failed with "incorrect number of dimensions"

Changes in version 1.5.2 (2026-12-03)
+ Added getRankShift and addRankShift

Expand Down
12 changes: 6 additions & 6 deletions R/AllGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ setGeneric("getStability", signature = "x", function(x, ...)
setGeneric("addStability", signature = "x", function(x, ...)
standardGeneric("addStability"))

#' @rdname getSurvival
#' @rdname getCox

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be deprecated. There could be deprecate.R file that has these deprecated functions.

That deprecated function could have nvar as an argument as it is also now changed.

#' @export
setGeneric("getSurvival", signature = "x", function(x, ...)
standardGeneric("getSurvival"))
setGeneric("getCox", signature = "x", function(x, ...)
standardGeneric("getCox"))

#' @rdname getSurvival
#' @rdname getCox
#' @export
setGeneric("addSurvival", signature = "x", function(x, ...)
standardGeneric("addSurvival"))
setGeneric("addCox", signature = "x", function(x, ...)
standardGeneric("addCox"))

#' @rdname getSamplingSummary
#' @export
Expand Down
66 changes: 66 additions & 0 deletions R/deprecate.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#' Deprecated functions
#'
#' These functions are deprecated. Use the functions named in the messages
#' instead.
#'
#' \code{getSurvival()} and \code{addSurvival()} are replaced by
#' \code{\link{getCox}()} and \code{\link{addCox}()}. Their argument
#' \code{nvar} is \code{max.features} in the new functions.
#' \code{addSurvival()} keeps its earlier default \code{name}.
#'
#' @param x A
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
#' object.
#'
#' @param name \code{Character vector} of length 3. Names for the results, as
#' in \code{\link{addCox}()}.
#' (Default: \code{c("survival_coef", "survival_risk_score", "survival")})
#'
#' @param ... Additional arguments. See the replacing function.
#'
#' @return See the replacing function.
#'
#' @name deprecate
NULL

#' @rdname deprecate
#' @export
setGeneric("getSurvival", signature = "x", function(x, ...)
standardGeneric("getSurvival"))

#' @rdname deprecate
#' @export
setMethod("getSurvival", signature = c(x = "SummarizedExperiment"),
function(x, ...){
.Deprecated(msg = paste0(
"'getSurvival' is deprecated. Use 'getCox' instead; ",
"'nvar' is now 'max.features'."))
args <- c(list(x = x), .rename_nvar(list(...)))
do.call(getCox, args)
}
)

#' @rdname deprecate
#' @export
setGeneric("addSurvival", signature = "x", function(x, ...)
standardGeneric("addSurvival"))

#' @rdname deprecate
#' @export
setMethod("addSurvival", signature = c(x = "SummarizedExperiment"),
function(
x, name = c("survival_coef", "survival_risk_score", "survival"),
...){
.Deprecated(msg = paste0(
"'addSurvival' is deprecated. Use 'addCox' instead; ",
"'nvar' is now 'max.features'."))
args <- c(list(x = x, name = name), .rename_nvar(list(...)))
do.call(addCox, args)
}
)

# The argument 'nvar' of getSurvival() is 'max.features' in getCox()
.rename_nvar <- function(args){
names(args)[names(args) == "nvar"] <- "max.features"
return(args)
}
Loading
Loading