From d1e73b9533656a2c1512d15598bb313d27e72ec4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 20:38:46 +0000 Subject: [PATCH 1/3] Fix UTF-8 encoding issue in survival.R Agent-Logs-Url: https://github.com/stjude/proteinpaint/sessions/3837e9d4-0093-4d0e-b58c-36c20acef205 Co-authored-by: xzhou82 <1619109+xzhou82@users.noreply.github.com> --- R/src/survival.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/src/survival.R b/R/src/survival.R index 640e416726..8c993042fe 100644 --- a/R/src/survival.R +++ b/R/src/survival.R @@ -35,8 +35,8 @@ library(jsonlite) library(survival) # stream in json input -con <- file("stdin", "r") -json <- readLines(con) +con <- file("stdin", "r", encoding="UTF-8") +json <- readLines(con, encoding="UTF-8") close(con) dat <- fromJSON(json) From 9fd702d59856475e5d3efc8e30736162d58accc4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 20:39:16 +0000 Subject: [PATCH 2/3] Fix UTF-8 encoding in cuminc.R, regression.R, and density.R Agent-Logs-Url: https://github.com/stjude/proteinpaint/sessions/3837e9d4-0093-4d0e-b58c-36c20acef205 Co-authored-by: xzhou82 <1619109+xzhou82@users.noreply.github.com> --- R/src/cuminc.R | 4 ++-- R/src/density.R | 4 ++-- R/src/regression.R | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/src/cuminc.R b/R/src/cuminc.R index 3cad4cb1fb..ba2867ad6d 100644 --- a/R/src/cuminc.R +++ b/R/src/cuminc.R @@ -252,8 +252,8 @@ compute_counts <- function(res, chart) { ################ # stream in json input -con <- file("stdin", "r") -json <- readLines(con) +con <- file("stdin", "r", encoding="UTF-8") +json <- readLines(con, encoding="UTF-8") close(con) input <- fromJSON(json) diff --git a/R/src/density.R b/R/src/density.R index 16e40dcb24..68d20e3da2 100644 --- a/R/src/density.R +++ b/R/src/density.R @@ -8,8 +8,8 @@ library(jsonlite) # with your values: # echo '{plot2Values: {"plotA": [1.2, 2, 3], "plotB": [4.5, 5, 6]}}' | Rscript ./density.R -con <- file("stdin", "r") -json <- readLines(con) +con <- file("stdin", "r", encoding="UTF-8") +json <- readLines(con, encoding="UTF-8") close(con) data <- fromJSON(json) plot2Values <- data$plot2Values diff --git a/R/src/regression.R b/R/src/regression.R index f32e62ee4d..8d122336d3 100644 --- a/R/src/regression.R +++ b/R/src/regression.R @@ -84,8 +84,8 @@ benchmark <- list() # stream in json input stime <- Sys.time() -con <- file("stdin", "r") -json <- readLines(con) +con <- file("stdin", "r", encoding="UTF-8") +json <- readLines(con, encoding="UTF-8") close(con) input <- fromJSON(json) etime <- Sys.time() From 90016e8cc2fd93223fd72f754df09ab40d9c59a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 20:40:46 +0000 Subject: [PATCH 3/3] Remove redundant encoding parameter from readLines() Agent-Logs-Url: https://github.com/stjude/proteinpaint/sessions/3837e9d4-0093-4d0e-b58c-36c20acef205 Co-authored-by: xzhou82 <1619109+xzhou82@users.noreply.github.com> --- R/src/cuminc.R | 2 +- R/src/density.R | 2 +- R/src/regression.R | 2 +- R/src/survival.R | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/src/cuminc.R b/R/src/cuminc.R index ba2867ad6d..bb0b99a198 100644 --- a/R/src/cuminc.R +++ b/R/src/cuminc.R @@ -253,7 +253,7 @@ compute_counts <- function(res, chart) { # stream in json input con <- file("stdin", "r", encoding="UTF-8") -json <- readLines(con, encoding="UTF-8") +json <- readLines(con) close(con) input <- fromJSON(json) diff --git a/R/src/density.R b/R/src/density.R index 68d20e3da2..e92a7b1fb2 100644 --- a/R/src/density.R +++ b/R/src/density.R @@ -9,7 +9,7 @@ library(jsonlite) # echo '{plot2Values: {"plotA": [1.2, 2, 3], "plotB": [4.5, 5, 6]}}' | Rscript ./density.R con <- file("stdin", "r", encoding="UTF-8") -json <- readLines(con, encoding="UTF-8") +json <- readLines(con) close(con) data <- fromJSON(json) plot2Values <- data$plot2Values diff --git a/R/src/regression.R b/R/src/regression.R index 8d122336d3..ce682f30c6 100644 --- a/R/src/regression.R +++ b/R/src/regression.R @@ -85,7 +85,7 @@ benchmark <- list() # stream in json input stime <- Sys.time() con <- file("stdin", "r", encoding="UTF-8") -json <- readLines(con, encoding="UTF-8") +json <- readLines(con) close(con) input <- fromJSON(json) etime <- Sys.time() diff --git a/R/src/survival.R b/R/src/survival.R index 8c993042fe..fcd5813dd5 100644 --- a/R/src/survival.R +++ b/R/src/survival.R @@ -36,7 +36,7 @@ library(survival) # stream in json input con <- file("stdin", "r", encoding="UTF-8") -json <- readLines(con, encoding="UTF-8") +json <- readLines(con) close(con) dat <- fromJSON(json)