From 63e4d5d1a7aec5651a54361c7a5994d20bf87cbe Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 14:52:13 +0100 Subject: [PATCH 01/12] Update seurat_helpers.R --- R/seurat_helpers.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/seurat_helpers.R b/R/seurat_helpers.R index 1022f1d..977be97 100644 --- a/R/seurat_helpers.R +++ b/R/seurat_helpers.R @@ -103,7 +103,7 @@ # Initialize result list result <- setNames( - lapply(unique_groups, function(x) list()), + lapply(unique_groups, function(x) setNames(list(), character(0))), unique_groups ) From 35b855a92bf105ee73f48e7cbc2e29b5371b7d17 Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:26:22 +0100 Subject: [PATCH 02/12] Update R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 5d18b0d..51713ef 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -44,6 +44,10 @@ jobs: extra-packages: any::rcmdcheck needs: check + - name: Pin ggrepel for older R + if: matrix.config.r != 'release' + run: Rscript -e 'pak::pkg_install("cran/ggrepel@0.9.6")' + - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true From 218c41b9c03aaf737fe362a2b13b8e8efa2d9c01 Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 14:51:22 +0100 Subject: [PATCH 03/12] Update schema.R --- R/schema.R | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/R/schema.R b/R/schema.R index 54d974f..478b226 100644 --- a/R/schema.R +++ b/R/schema.R @@ -108,6 +108,14 @@ LLMModelConfig <- function(provider, mask_job_details <- if (is.null(nm)) rep(TRUE, length(query_list$input_data)) else !endsWith(nm, "jobDetails") query_list$input_data <- query_list$input_data[mask_job_details] + # Ensure fields the server expects as JSON objects serialize to {} not [] + dict_fields <- c("clusterMetadata", "clusterLabels", "infoTags", "expressionData") + for (field in dict_fields) { + val <- query_list$input_data[[field]] + if (is.list(val) && length(val) == 0 && is.null(names(val))) { + query_list$input_data[[field]] <- setNames(list(), character(0)) + } + } return(query_list) } @@ -142,7 +150,7 @@ LLMModelConfig <- function(provider, InputData <- function(studyInfo = "", infoTags = list(), clusterLabels = list(), - clusterMetadata = list(), + clusterMetadata = setNames(list(), character(0)), markerGenes = list(), visualizationData = NULL, expressionData = list(), From 8add6f3c0e902e385a37ac2bdf3df655e77fa18c Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 14:51:43 +0100 Subject: [PATCH 04/12] Update cytetype.R --- R/cytetype.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/cytetype.R b/R/cytetype.R index 2666040..6c9b3da 100644 --- a/R/cytetype.R +++ b/R/cytetype.R @@ -89,7 +89,7 @@ PrepareCyteTypeR <- function(obj, # Map cluster ids to use those natural numbers names(group_metadata) <- cluster_map[names(group_metadata)] - } else{group_metadata <- list() + } else{group_metadata <- setNames(list(), character(0)) } print(paste("Preparing marker genes with top",n_top_genes,"genes...")) From a84d8d73ddf0df588f4e40a1e6b13b228e0c47b3 Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 15:12:53 +0100 Subject: [PATCH 05/12] Update R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 51713ef..34a9b99 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -39,15 +39,15 @@ jobs: http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true + - name: Pin ggrepel for older R + if: matrix.config.r != 'release' + run: Rscript -e 'pak::pkg_install("cran/ggrepel@0.9.6")' + - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: any::rcmdcheck needs: check - - name: Pin ggrepel for older R - if: matrix.config.r != 'release' - run: Rscript -e 'pak::pkg_install("cran/ggrepel@0.9.6")' - - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true From 03d2a713d4bb2e2eb9285ef6c5e9017b9fcccaf7 Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 15:15:16 +0100 Subject: [PATCH 06/12] Update R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 34a9b99..50a4b29 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -41,7 +41,7 @@ jobs: - name: Pin ggrepel for older R if: matrix.config.r != 'release' - run: Rscript -e 'pak::pkg_install("cran/ggrepel@0.9.6")' + run: Rscript -e 'install.packages("https://cran.r-project.org/src/contrib/Archive/ggrepel/ggrepel_0.9.6.tar.gz", repos = NULL, type = "source")' - uses: r-lib/actions/setup-r-dependencies@v2 with: From 8ccf3ac0747e551c54e1356bade4334fa605e917 Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 15:34:18 +0100 Subject: [PATCH 07/12] Revert "Update cytetype.R" This reverts commit 8add6f3c0e902e385a37ac2bdf3df655e77fa18c. --- R/cytetype.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/cytetype.R b/R/cytetype.R index 6c9b3da..2666040 100644 --- a/R/cytetype.R +++ b/R/cytetype.R @@ -89,7 +89,7 @@ PrepareCyteTypeR <- function(obj, # Map cluster ids to use those natural numbers names(group_metadata) <- cluster_map[names(group_metadata)] - } else{group_metadata <- setNames(list(), character(0)) + } else{group_metadata <- list() } print(paste("Preparing marker genes with top",n_top_genes,"genes...")) From ebde7a2e4622fb6e92f64fd37de7b527c8b65974 Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 15:34:29 +0100 Subject: [PATCH 08/12] Revert "Update seurat_helpers.R" This reverts commit 63e4d5d1a7aec5651a54361c7a5994d20bf87cbe. --- R/seurat_helpers.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/seurat_helpers.R b/R/seurat_helpers.R index 977be97..1022f1d 100644 --- a/R/seurat_helpers.R +++ b/R/seurat_helpers.R @@ -103,7 +103,7 @@ # Initialize result list result <- setNames( - lapply(unique_groups, function(x) setNames(list(), character(0))), + lapply(unique_groups, function(x) list()), unique_groups ) From a54ed4a1cee060dc59bb0149d26a60ea90dc7cec Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 15:36:07 +0100 Subject: [PATCH 09/12] Update schema.R --- R/schema.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/schema.R b/R/schema.R index 478b226..ddc5d8d 100644 --- a/R/schema.R +++ b/R/schema.R @@ -150,7 +150,7 @@ LLMModelConfig <- function(provider, InputData <- function(studyInfo = "", infoTags = list(), clusterLabels = list(), - clusterMetadata = setNames(list(), character(0)), + clusterMetadata = list(), markerGenes = list(), visualizationData = NULL, expressionData = list(), From 449e234c9a350b604ab3d838d92559ff4dcda6a9 Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 15:42:52 +0100 Subject: [PATCH 10/12] Update R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 50a4b29..a246997 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -39,15 +39,18 @@ jobs: http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - name: Pin ggrepel for older R - if: matrix.config.r != 'release' - run: Rscript -e 'install.packages("https://cran.r-project.org/src/contrib/Archive/ggrepel/ggrepel_0.9.6.tar.gz", repos = NULL, type = "source")' - - uses: r-lib/actions/setup-r-dependencies@v2 + if: matrix.config.r == 'release' with: extra-packages: any::rcmdcheck needs: check + - uses: r-lib/actions/setup-r-dependencies@v2 + if: matrix.config.r != 'release' + with: + extra-packages: any::rcmdcheck, cran/ggrepel@0.9.6 + needs: check + - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true From 0d1df4bec230a6fa1ef7b3f0e596300816562662 Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 15:48:19 +0100 Subject: [PATCH 11/12] Increment version number to 0.3.2 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 39fd89c..361ec4a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: CyteTypeR Title: CyteType for R -Version: 0.3.1 +Version: 0.3.2 Description: CyteTypeR is the R version of CyteType python package. Authors@R: person("Nygen Analytics AB", , ,"contact@nygen.io", role = c("aut", "cre")) From a6637f8b3dc52c798e1805a03e52df34662373ca Mon Sep 17 00:00:00 2001 From: Yi Su <90744702+suu-yi@users.noreply.github.com> Date: Fri, 27 Feb 2026 16:04:27 +0100 Subject: [PATCH 12/12] fix attr to scalar --- R/artifacts.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/artifacts.R b/R/artifacts.R index d0e3ec7..59c5aab 100644 --- a/R/artifacts.R +++ b/R/artifacts.R @@ -81,8 +81,8 @@ on.exit(rhdf5::H5Fclose(fid), add = TRUE) rhdf5::h5createGroup(fid, "vars") - rhdf5::h5writeAttribute(as.integer(n_obs), h5obj = out_file, name = "n_obs", h5loc = "vars") - rhdf5::h5writeAttribute(as.integer(n_vars), h5obj = out_file, name = "n_vars", h5loc = "vars") + rhdf5::h5writeAttribute(as.integer(n_obs), h5obj = out_file, name = "n_obs", h5loc = "vars", asScalar = TRUE) + rhdf5::h5writeAttribute(as.integer(n_vars), h5obj = out_file, name = "n_vars", h5loc = "vars", asScalar = TRUE) # Create extensible datasets (equivalent to maxshape=(None,) in h5py) max_nnz <- n_obs * n_vars # upper bound