diff --git a/.Rbuildignore b/.Rbuildignore index ff15c52..b05a8f2 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,5 @@ ^.*\.{jpeg,png,gif,tiff}$ .cicd-env ^LICENSE.md +^CRAN-SUBMISSION$ +^\.Rcheck$ diff --git a/.gitignore b/.gitignore index bb96863..3fba2cc 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ .RData *.Rproj* .Rproj.user +*CRAN-SUBMISSION* +..Rcheck diff --git a/DESCRIPTION b/DESCRIPTION index 59d1f71..794e69e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,15 +1,16 @@ Package: iSubGen Title: Integrative Subtype Generation -Version: 1.0.4 -Date: 2026-01-20 +Version: 1.1.0 +Date: 2026-01-21 Authors@R: c( - person("Mao Tian", role = "cre", email = "mtian@sbpdiscovery.org"), - person("Paul Boutros", role = "aut"), - person("Natalie Fox", role = "aut"), - person("Dan Knight", role = "ctb")) + person("Natalie", "Fox", role = "aut"), + person("Paul", "Boutros", role = "aut"), + person("Mao", "Tian", email = "mtian@sbpdiscovery.org", role = c("cre", "ctb")), + person("Dan", "Knight", role = "ctb") +) Description: Multi-data type subtyping, which is data type agnostic and accepts missing data. Subtyping is performed using intermediary assessments created with autoencoders and similarity calculations. Depends: R (>= 3.2.3) -Imports: ConsensusClusterPlus, cluster (>= 1.14.4), keras, tensorflow, philentropy +Imports: ConsensusClusterPlus, cluster (>= 1.14.4), keras3, tensorflow, philentropy Suggests: knitr, rmarkdown Remotes: bioc::ConsensusClusterPlus diff --git a/NAMESPACE b/NAMESPACE index 6c456b3..c8e4406 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,4 +5,4 @@ importFrom("grDevices", "colorRampPalette"); importFrom("cluster","diana"); importFrom("ConsensusClusterPlus","ConsensusClusterPlus","calcICL"); importFrom("philentropy","distance"); -import(tensorflow, keras); +import(tensorflow, keras3); diff --git a/NEWS.md b/NEWS.md index a7c1e98..94d5d13 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,8 @@ -# iSubGen 1.0.4 (2026-01-20) +# iSubGen 1.1.0 (2026-01-21) ## Changed * Update maintainer information and email +* Update `keras` package to `keras3` # iSubGen 1.0.3 (2025-06-18) diff --git a/R/create.autoencoder.R b/R/create.autoencoder.R index 92851b9..59d469c 100644 --- a/R/create.autoencoder.R +++ b/R/create.autoencoder.R @@ -60,7 +60,7 @@ create.autoencoder <- function( optimizer = 'adam' ); - ae.output.file <- paste0(sub('/$','',model.file.output.dir),'/',data.type,'_model.hdf5'); + ae.output.file <- paste0(sub('/$','',model.file.output.dir),'/',data.type,'_model.keras'); checkpoint <- callback_model_checkpoint( filepath = ae.output.file, save_best_only = TRUE, diff --git a/R/create.autoencoder.irf.matrix.R b/R/create.autoencoder.irf.matrix.R index a986708..42b8126 100644 --- a/R/create.autoencoder.irf.matrix.R +++ b/R/create.autoencoder.irf.matrix.R @@ -36,14 +36,14 @@ create.autoencoder.irf.matrix <- function( if (data.type %in% names(autoencoders)) { # load the neural net for the data.type model <- autoencoders[[data.type]]; - if (is.character(autoencoders[[data.type]]) && grep('hdf5$',autoencoders[[data.type]]) == 1) { - model <- load_model_hdf5( + if (is.character(autoencoders[[data.type]]) && grep('keras$',autoencoders[[data.type]]) == 1) { + model <- load_model( autoencoders[[data.type]], compile = FALSE); } # create the autoencoder encoding layers from input to the bottleneck layer - intermediate.layer.model <- keras_model(inputs = model$input, outputs = get_layer(model, 'bottleneck')$output); + intermediate.layer.model <- keras_model(inputs = model$inputs, outputs = get_layer(model, 'bottleneck')$output); # get the bottleneck values from the autoencoder bottleneck.values <- predict(intermediate.layer.model,x = t(data.matrices[[data.type]])); diff --git a/README.md b/README.md index a738d8b..e1a4371 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ The first step is to load the data. Here the genomic features are rows and patie ```{r load-data} # Load the library and the data included with the package library(iSubGen); +library(tensorflow); +library(keras3); +library(reticulate); + molecular.data <- list(); for(i in c('cna','methy','snv')) { molecular.data[[i]] <- load.molecular.aberration.data( @@ -72,7 +76,7 @@ A benefit of using autoencoders for compressing features is that autoencoders ca ### Create independent reduced features (IRFs) We create autoencoders individually for each data type. -The create.autoencoder function is a wrapper function to create an autoencoder using the [keras](https://cran.r-project.org/package=keras) package. +The create.autoencoder function is a wrapper function to create an autoencoder using the [keras3](https://cran.r-project.org/package=keras3) package. Here we create two compressed features for the CNA feature set and one compressed feature for each of the SNV and methylation feature sets. ```{r ae-matrix} @@ -231,7 +235,7 @@ IRF: Independent Reduced Features. iSubGen: integrative Subtype Generation. This tool! -Keras R package: [https://cran.r-project.org/package=keras](https://cran.r-project.org/package=keras) +keras3 R package: [https://cran.r-project.org/package=keras3](https://cran.r-project.org/package=keras3) Methylation: a DNA modification where methyl groups of are added to cytosines in DNA to help regulate DNA transcription. diff --git a/man/create.autoencoder.Rd b/man/create.autoencoder.Rd index 00759c6..429151d 100644 --- a/man/create.autoencoder.Rd +++ b/man/create.autoencoder.Rd @@ -1,23 +1,23 @@ \name{create.autoencoder} \alias{create.autoencoder} \title{Create an autoencoder for dimensionality reduction} -\description{Create an autoencoder for dimensionality reduction using keras and tensorflow packages} +\description{Create an autoencoder for dimensionality reduction using keras3 and tensorflow packages} \usage{ create.autoencoder(data.type, data.matrix, encoder.layers.node.nums = c(15,2), -autoencoder.activation = 'tanh', optimization.loss.function = 'mean_squared_error', +autoencoder.activation = 'tanh', optimization.loss.function = 'mean_squared_error', model.file.output.dir = '.') } \arguments{ \item{data.type}{data type ID. The ID will be used for naming the output file} \item{data.matrix}{matrix with data features as rows and patients as columns} - \item{encoder.layers.node.nums}{vector with the number of nodes for each layer when the reducing the feature dimensions within the autoencoder. The autoencoder will be made symmetrically so the number of nodes in each layer will be used in reverse, not repeating the last layer to re encode the features in the autoencoder} + \item{encoder.layers.node.nums}{vector with the number of nodes for each layer when the reducing the feature dimensions within the autoencoder. The autoencoder will be made symmetrically so the number of nodes in each layer will be used in reverse, not repeating the last layer to re encode the features in the autoencoder} \item{autoencoder.activation}{activation function to use in the autoencoder} \item{optimization.loss.function}{loss function used for optimization while fitting the autoencoder} \item{model.file.output.dir}{file location for the autoencoder file} } \value{ - \item{autoencoder}{the autoencoder created by the keras package} - \item{autoencoder.file}{the hdf5 file that the model was saved in and can be loaded from} + \item{autoencoder}{the autoencoder created by the keras3 package} + \item{autoencoder.file}{the keras file that the model was saved in and can be loaded from} } \author{Natalie Fox} \examples{ diff --git a/metadata.yaml b/metadata.yaml index b93fffa..a7f40aa 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -4,5 +4,5 @@ Description: 'Multi-data type subtyping, which is data type agnostic and accepts Maintainers: 'mtian@sbpdiscovery.org' Contributors: ['Natalie Fox', 'Paul C. Boutros', 'Mao Tian'] Languages: 'R' -Dependencies: ['ConsensusClusterPlus', 'cluster', 'keras', 'tensorflow', 'philentropy'] +Dependencies: ['ConsensusClusterPlus', 'cluster', 'keras3', 'tensorflow', 'philentropy'] References: 'Fox, Natalie S., Mao Tian, Alexander L. Markowitz, Syed Haider, Constance H. Li, and Paul C. Boutros. “iSubGen Generates Integrative Disease Subtypes by Pairwise Similarity Assessment.” Cell Reports Methods 4, no. 11 (2024): 100884. https://doi.org/10.1016/j.crmeth.2024.100884.' diff --git a/vignettes/iSubGenGuide.Rnw b/vignettes/iSubGenGuide.Rnw index 7d64782..7b6760d 100755 --- a/vignettes/iSubGenGuide.Rnw +++ b/vignettes/iSubGenGuide.Rnw @@ -91,6 +91,9 @@ The first step is to load the data. Here the genomic features are rows and patie <>= # Load the library and the data included with the package library(iSubGen); +library(tensorflow); +library(keras3); +library(reticulate); molecular.data <- list(); for (i in c('cna','methy','snv')) { molecular.data[[i]] <- load.molecular.aberration.data( @@ -128,7 +131,7 @@ A benefit of using autoencoders for compressing features is that autoencoders ca \subsection{Create independent reduced features (IRFs)} We create autoencoders individually for each data type. -The create.autoencoder function is a wrapper function to create an autoencoder using the \href{https://cran.r-project.org/package=keras}{keras} package. +The create.autoencoder function is a wrapper function to create an autoencoder using the \href{https://cran.r-project.org/package=keras3}{keras3} package. Here we create two compressed features for the CNA feature set and one compressed feature for each of the SNV and methylation feature sets. <>= @@ -276,7 +279,7 @@ DNA segments can be deleted so there are less than 2 copies. \\ \noindent \textbf{iSubGen:} integrative Subtype Generation. This tool!\\ -\noindent \textbf{Keras R package:} \url{https://cran.r-project.org/package=keras} \\ +\noindent \textbf{keras3 R package:} \url{https://cran.r-project.org/package=keras3} \\ \noindent \textbf{Methylation:} a DNA modification where methyl groups of are added to cytosines in DNA to help regulate DNA transcription. \\