Changelog
Source:NEWS.md
OptSurvCutR 0.1.9.3 (2026-03-15)
DOCUMENTATION & STANDARDS
Graphical Abstract: Added the new graphical abstract to the image/ folder for inclusion in the README.md.
## COMMUNITY & OUTREACH
Presentations: Presented at FOSDEM 2026 in the Bioinformatics & Computational Biology DevRoom in Brussels, Belgium. View lightning talk details
Presentations: Presented at R!SK 2026 (February 18–19, 2026). This 100% online conference focuses on evaluating, measuring, and mitigating risk across diverse industries including healthcare, finance, and insurance. The event featured deep content sessions and live Q&A interactions. View presentation abstract
OptSurvCutR 0.1.9.2 (2025-11-25)
ROPENSCI REVIEW UPDATES (ITERATION 2)
BREAKING CHANGES
-
Renamed Functions:
plot_optimization_curve()plot_optimisation_curve()(British English) andplot_schoenfeld()plot_cutpoint_residuals()(Namespace conflict). -
Renamed Argument:
maxiteris nowmax.generationsin genetic algorithm functions to matchrgenoud.
IMPROVEMENTS
-
Explicit Parameters: Exposed
pop.sizeandmax.generationsas explicit arguments infind_cutpoint()andfind_cutpoint_number(). -
Consistent Logic: All functions now use
floor()fornmincalculation to ensure identical sample size handling. -
Better Validation:
validate_cutpoint()now acceptsnminas a proportion and issues an informative message when using the default 90% buffer (Standard G2.10). -
Internal Cleanup: Removed export of helper operator
%||%.
DOCUMENTATION & STANDARDS
- British English: Standardised all functions and documentation (e.g., “optimise”, “summarise”).
-
Standards Compliance: Audited and updated all
@srrstatstags; moved non-applicable standards toR/OptSurvCutR-package.R. - Testing: Added tests for new genetic parameters and updated snapshot tests for S3 methods.
OptSurvCutR 0.1.9.1 (2025-11-20)
POST-ROPENSCI INITIAL SUBMISSION
- Renamed
plot_diagnostics()→plot_schoenfeld()to avoid name clash with another package. - Stabilised and accepted all snapshot tests for pathological
find_cutpoint_number_resultS3 methods (now use real criterion"BIC"). - Cleaned DESCRIPTION: removed unused Suggests (
coxphf,patchwork,pROC,tibble,srr) and Remotes (ropensci-review-tools/srr). - Test suite now passes with zero failures/warnings on R CMD check.
OptSurvCutR 0.1.9
REFACTORING & MAINTENANCE
-
Simplified Parallel Interface: The
use_parallelargument was removed fromvalidate_cutpoint(). Parallel execution is now controlled exclusively by then_coresargument (n_cores = 1for sequential,n_cores > 1for parallel). -
Consolidated Validation Logic: A new internal helper
.validate_event_column()was created inR/utils-helpers.Rto centralise the logic for checking that an event column is numeric and contains only 0s and 1s. Bothfind_cutpoint_number()and the internal helper.validate_data_conditions()(also inR/utils-helpers.R) were updated to call this function, eliminating duplicated code. -
Simplified Parallel Code: In
validate_cutpoint(), the brittlefunctions_to_exportblock was removed. The function now correctly relies on the.packages = "OptSurvCutR"argument in theforeachloop, making it easier to maintain.
BUG FIXES
-
Fixed Parallel Reproducibility: A bug in
validate_cutpoint()that prevented true reproducibility for parallel runs (n_cores > 1) was fixed. The function now checks for and registers the doRNG package when aseedis provided, ensuring results are identical regardless of the number of cores used. The incorrectset.seed(i)call inside theforeachloop was removed. -
Improved S3 Method Robustness: The
summary.find_cutpoint_number_result()S3 method was updated to robustly handleNULLvalues in theobject$parameterslist (e.g.,method = NULL). This prevents potential errors if a result object is created manually or improperly and aligns its behaviour with theprint()method.
DOCUMENTATION
-
Clarified Log-Rank Test: The documentation for
find_cutpoint()was updated to clarify that whencovariatesare provided, the"logrank"criterion is automatically generalized to the more appropriate Cox score test.
OptSurvCutR 0.1.8
CRITICAL BUG FIXES
-
Parallel Validation: Fixed a critical bug where
validate_cutpoint(use_parallel = TRUE)would fail. This was caused by helper functions not being exported to the parallel workers. -
Event Column Validation: Fixed a major bug where non-numeric
outcome_eventdata (e.g.,"0:LIVING") caused silent failures. The functions now “fail-fast” with an error, validating the column is numeric with only 0s and 1s. -
Genetic Algorithm Reporting: Fixed a bug where
method = "genetic"would report a failure (-Inf) as a successful result. The functions now correctly check for the failure signal and returnNA.
NEW FEATURES
-
G3.1a Compliance — Schoenfeld Residual Diagnostics: Added
plot_diagnostics()to generate publication-ready Schoenfeld residual plots, assessing the proportional hazards (PH) assumption.
IMPROVEMENTS
-
Code Quality (Refactoring): Refactored
find_cutpoint()to resolve “high cyclomatic complexity”NOTEs by moving validation logic to internal helper functions. - Test Coverage: Increased test coverage by adding new unit tests for error conditions, edge cases, and validation logic.
-
rOpenSci/
pkgcheckCompliance:- Added examples to all exported functions.
- Added
@srrstatstags to satisfy multi-directory requirements.
-
R CMD checkCompliance: Addressed allERRORs,WARNINGs, andNOTEs:- Added
inst/WORDLIST,_PACKAGEdocumentation, and fixed emptyRdsections. - Added
codemeta.jsonto.Rbuildignore.
- Added
-
Code Style:
- Reformatted code to follow Tidyverse Style Guide principles (e.g.,
<-for assignment,"for strings, consistent spacing around operators). - Strictly enforced an 80-character maximum line length for all code, comments, and documentation.
- Made Roxygen documentation, inline comments, and user-facing messages more concise.
- Replaced
sapply()with type-safevapply()in S3 methods to prevent potential bugs.
- Reformatted code to follow Tidyverse Style Guide principles (e.g.,
-
Internal Data: The
crc_viromedataset’sstatuscolumn was corrected to be numeric 0/1 to match documentation and new validation rules.
OptSurvCutR 0.1.7
NEW FEATURES
-
Covariate Adjustment Added: Both
find_cutpoint()(formethod = "systematic"andmethod = "genetic") andfind_cutpoint_number()now support covariate adjustment via thecovariatesargument. This allows finding optimal cut-points and determining the optimal number of groups while accounting for potential confounders, providing a more robust assessment of a biomarker’s independent prognostic value.
IMPROVEMENTS
-
Major Performance Optimisation: Significantly optimised performance in
find_cutpoint()forcriterion = "hazard_ratio"andcriterion = "p_value"(both systematic and genetic methods). This was achieved by removing computationally expensivesummary()calls, extracting coefficients and statistics directly from model objects, and using a fast, manual Likelihood Ratio Test for p-value calculation. -
Simplified Parallelism: Removed internal parallel processing (
use_parallelargument) fromfind_cutpointandfind_cutpoint_numbersystematic search. This prevents potential issues with nested parallel calls and relies on standard external parallelisation approaches, such as the explicit parallel loop withinvalidate_cutpoint. -
Test Suite Overhaul: Revamped the entire
testthatsuite for improved reliability and robustness. Replaced brittleexpect_snapshot()tests with more stable checks likeexpect_output(),expect_s3_class(), and specific value comparisons. Corrected logic for error and warning expectations and improved mocking for dependency checks. Code coverage increased significantly (for example, to ~86%). -
User-Friendly
rgenoudCheck: Added clear, informative error messages usingcliinfind_cutpoint()andfind_cutpoint_number()that trigger immediately ifmethod = "genetic"is requested but the suggestedrgenoudpackage is not installed, guiding the user on how to install it. -
Dependency Management: Moved optional dependencies
broom(for plotting) andwithr(for testing) fromImportstoSuggestsin theDESCRIPTIONfile, making the core package installation lighter. Removed unusedmagrittrimport. -
Simplified Evidence Labels: Renamed evidence labels in
find_cutpoint_number()results for brevity (for example, “Substantial support” -> “Substantial”). -
Code Maintainability: Centralised all
utils::globalVariablesdefinitions intoglobals.Rto resolve R CMD checkNOTEsand improve clarity. Removed redundant code.
BUG FIXES
-
quiet = TRUE Message Fix: Fixed a critical bug where
find_cutpoint()andfind_cutpoint_number()would fail silently (no console message) whenquiet = TRUEwas set. Failure messages are now always printed to the console via internal helpers, regardless of thequietsetting, improving user feedback on errors. -
Genetic Algorithm Edge Cases: Added more robust input validation and handling within the internal
.run_genetic_search()function to gracefully manage edge cases like insufficient data variability or non-finite predictor ranges, preventing downstream errors and cryptic warnings. -
Genetic Algorithm Monitor: Fixed the internal monitoring function used by the genetic algorithm (
rgenoud::genoud) to correctly respect theprint.levelargument (controlled indirectly via user functions), ensuring progress updates are displayed or suppressed as intended. -
NAMESPACE Fix (stats::): Resolved
NAMESPACEerrors and related test failures by adding explicitstats::calls where needed (for example, forstats::quantile,stats::sd,stats::pchisq) and ensuring correct regeneration of theNAMESPACEfile viadevtools::document(). -
foreach NOTE Fix: Resolved R CMD check
NOTEregarding “no visible binding for global”.
OptSurvCutR 0.1.6
NEW FEATURES
- Added a vignette demonstrating the use of
find_cutpoint()andvalidate_cutpoint()with TCGA virome data (for example, Alphapapillomavirus as a predictor), guiding users through cut-point optimisation and stability assessment for survival analysis [https://github.com/paytonyau/OptSurvCutR/commit/aa41ca3cb3ff7fdff4cbf6cf8d5de5e4494d3500]. - Introduced comprehensive unit tests using
testthat, covering core functions (find_cutpoint(),find_cutpoint_number(),validate_cutpoint()) and edge cases like missing data or small sample sizes, with code coverage reporting viacovrto ensure reliability (>80% coverage) [https://github.com/paytonyau/OptSurvCutR/commit/6579072b087b880b448e101d8eef37f8c4fa5550].
IMPROVEMENTS
- Optimised the genetic algorithm in
find_cutpoint()by implementing adaptivepop.size(for example, 50 fornum_cuts = 1) andmax.generations(for example, 75), reducing runtime by 20–50% for survival datasets while maintaining accuracy for optimal cut-point selection [https://github.com/paytonyau/OptSurvCutR/commit/e0cec20c2a72e48b39e1833742e8d7d829621f39]. - Enhanced error messages in
validate_cutpoint()to provide specific feedback on bootstrap validation failures, such as insufficient sample sizes or non-convergingcoxphmodels, improving user debugging experience [https://github.com/paytonyau/OptSurvCutR/commit/92ef362cec36ee9ae976f12a61b65db51cc79d94]. - Added a
pkgdownGitHub Action to automatically build a package website, improving documentation accessibility, and updated README with badges for build status and code coverage to signal package reliability [https://github.com/paytonyau/OptSurvCutR/commit/38712b8aa3cb919556bdf0e9cba6ca27fda10a60]. - Updated
DESCRIPTIONwith corrected URLs, dependency versions, and regenerated Rd files for consistent documentation across all functions [https://github.com/paytonyau/OptSurvCutR/commit/d85d4a14a1a10fb7f68537ea64ef4007c3be465a].
BUG FIXES
- Fixed NA handling in
find_cutpoint()to robustly process survival datasets with missing predictor values, preventing errors incoxphorsurvdiffmodel fitting for real-world data like TCGA virome datasets [https://github.com/paytonyau/OptSurvCutR/commit/059a288363c9b7b30272301b709378cb58d76d2b].
OptSurvCutR 0.1.5
IMPROVEMENTS
- Updated core functions (for example,
find_cutpoint(),find_cutpoint_number()) with improved numerical stability and accuracy for survival model fitting, particularly for genetic algorithm convergence in high-dimensional predictors [https://github.com/paytonyau/OptSurvCutR/commit/9338d0479c34069933562cb6b360428aad9dd6fc].
BUG FIXES
- Fixed bugs in script handling and input validation, improving reliability for edge cases like small datasets or constant predictors in survival analysis [https://github.com/paytonyau/OptSurvCutR/commit/1de3e1048dcaa33fa8cbb6eab0fa8d89ec5d134c].
- Reverted prior bug fixes to prevent potential regressions, ensuring stable behaviour in
validate_cutpoint()during bootstrap validation runs [https://github.com/paytonyau/OptSurvCutR/commit/d65fa328634a480a27bde6f64f8d615205e12225].
OptSurvCutR 0.1.0
NEW FEATURES
- Initial release of
OptSurvCutRfor optimising cut-points in survival analysis. - Added
find_cutpoint()to identify optimal cut-points for continuous predictors using systematic or genetic algorithms (viargenoud) with log-rank, p-value, or hazard-ratio criteria. - Added
find_cutpoint_number()to select the optimal number of cut-points using AIC, AICc, or BIC. - Added
validate_cutpoint()for bootstrap-based stability assessment of cut-points. - Supports survival models via
survival::coxphandsurvival::survdiff. - Includes example usage with simulated churn data, adaptable to TCGA virome datasets (for example, Alphapapillomavirus).