From 3c9ffcd97d8bc2c5b2c4accfd18bf3c328e81434 Mon Sep 17 00:00:00 2001 From: cristianetaniguti Date: Sun, 7 Jan 2024 14:42:30 -0600 Subject: [PATCH 1/3] fix read image --- Dockerfile | 17 +++++++++-------- R/graphics_poly_emp.R | 4 ++-- README.md | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 866f38d..d6c18f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,15 +23,16 @@ RUN Rscript -e 'remotes::install_version("golem",upgrade="never", version = "0.3 RUN Rscript -e 'remotes::install_version("shinymanager",upgrade="never", version = "1.0.400")' RUN Rscript -e 'remotes::install_version("pROC",upgrade="never", version = "1.18.0")' RUN Rscript -e 'remotes::install_version("vroom",upgrade="never", version = "1.5.3")' -RUN Rscript -e 'remotes::install_version("largeList",upgrade="never", version = "0.3.1")' RUN Rscript -e 'remotes::install_version("shinydashboard",upgrade="never", version = "0.7.2")' RUN Rscript -e 'remotes::install_github("tpbilton/GUSbase", ref = "92119b9c57faa7abeede8236d24a4a8e85fb3df7")' RUN Rscript -e 'remotes::install_github("tpbilton/GUSMap@4d7d4057049819d045750d760a45976c8f30dac6")' RUN Rscript -e 'remotes::install_github("Cristianetaniguti/onemap@7f5ac29d65d0bd82d9e46fcc2a26e3fc904a0782")' -RUN mkdir /build_zone -ADD . /build_zone -WORKDIR /build_zone -RUN R -e 'remotes::install_local(upgrade="never")' -RUN rm -rf /build_zone -EXPOSE 3838 -CMD ["R", "-e", "options('shiny.port'=3838,shiny.host='0.0.0.0');Reads2MapApp::run_app()"] +RUN Rscript -e 'remotes::install_github("Yuchun-Zhang/R_largeList", ref = "v0.3.1", subdir = "largeList")' + +RUN apt-get update && apt-get install -y libtcl libtk + +RUN Rscript -e 'remotes::install_github("mmollina/mappoly")' +RUN Rscript -e 'remotes::install_github("Cristianetaniguti/Reads2MapApp")' + +EXPOSE 80 +CMD ["R", "-e", "options('shiny.port'=80,shiny.host='0.0.0.0');Reads2MapApp::run_app()"] \ No newline at end of file diff --git a/R/graphics_poly_emp.R b/R/graphics_poly_emp.R index e369544..a5740cb 100644 --- a/R/graphics_poly_emp.R +++ b/R/graphics_poly_emp.R @@ -57,8 +57,8 @@ prepare_poly_datas_emp <- function(x = NULL, example_emp = NULL){ temp_item <- list() for(i in 1:length(files)){ if(grepl("map", files[i]) & !grepl("0", files[i])){ - temp_item[[i]] <- list(readRDS(files[i])) - } else temp_item[[i]] <- readRDS(files[i]) + temp_item[[i]] <- list(readRDS(gsub("/$", "", files[i]))) + } else temp_item[[i]] <- readRDS(gsub("/$", "", files[i])) } } else temp_item <- NULL names(temp_item) <- sapply(strsplit(basename(files), "_"), function(x) paste0(x[1:3], collapse = "_")) diff --git a/README.md b/README.md index 7203a06..1a4e591 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## Reads2Map App -This shiny app plots graphics for descriptive analyses of the datasets generated by the [Reads2Map workflow](https://github.com/Cristianetaniguti/Reads2Map) workflows. Upload your results in the `Upload data` session. +This shiny app plots graphics for descriptive analyses of the datasets generated by the [Reads2Map ](https://github.com/Cristianetaniguti/Reads2Map) workflows. Upload your results in the `Upload data` session. Each icon at the left corner of this page points to a different dataset and produces interactive plots. From 2d100db102054fcf35dba59ee8282cc216e95099 Mon Sep 17 00:00:00 2001 From: cristianetaniguti Date: Sun, 7 Jan 2024 14:50:49 -0600 Subject: [PATCH 2/3] fix read 2 --- Dockerfile | 2 +- R/graphics_emp.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d6c18f7..d2ea398 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ RUN Rscript -e 'remotes::install_github("Yuchun-Zhang/R_largeList", ref = "v0.3. RUN apt-get update && apt-get install -y libtcl libtk RUN Rscript -e 'remotes::install_github("mmollina/mappoly")' -RUN Rscript -e 'remotes::install_github("Cristianetaniguti/Reads2MapApp")' +RUN Rscript -e 'remotes::install_github("Cristianetaniguti/Reads2MapApp" )' EXPOSE 80 CMD ["R", "-e", "options('shiny.port'=80,shiny.host='0.0.0.0');Reads2MapApp::run_app()"] \ No newline at end of file diff --git a/R/graphics_emp.R b/R/graphics_emp.R index 2f640d2..6bc3c90 100644 --- a/R/graphics_emp.R +++ b/R/graphics_emp.R @@ -54,13 +54,13 @@ prepare_datas_emp <- function(x = NULL, example_emp = NULL){ temp_dat <- list() idx <- grep("sequences",datas)[-1] for(i in 1:length(idx)){ - temp_dat[[i]] <- readRDS(datas[[idx[i]]]) + temp_dat[[i]] <- readRDS(gsub("/$", "", datas[[idx[i]]])) } names_rdatas <- basename(unlist(datas[idx])) } else { ext <- sapply(strsplit(basename(datas[[grep("sequences",datas)]]), "[.]"), function(x) x[length(x)]) if(ext == "llo") temp_dat <- largeList::readList(datas[[grep("sequences",datas)]]) else - temp_dat <- readRDS(datas[[grep("sequences",datas)]]) + temp_dat <- readRDS(gsub("/$", "", datas[[grep("sequences",datas)]])) names_rdatas <- vroom(datas[[grep("names.tsv.gz", datas)]], delim = "\t", show_col_types = FALSE) names_rdatas <- as.data.frame(names_rdatas)[,1] if(length(grep("gusmap", names_rdatas)) > 0){ From 05dc7405858c446233b20179cb8b0a44980aa2a7 Mon Sep 17 00:00:00 2001 From: cristianetaniguti Date: Sun, 7 Jan 2024 15:05:09 -0600 Subject: [PATCH 3/3] remove / --- Dockerfile | 2 +- R/graphics_emp.R | 7 ++++--- R/graphics_poly_emp.R | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index d2ea398..cc5b5cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ RUN Rscript -e 'remotes::install_github("Yuchun-Zhang/R_largeList", ref = "v0.3. RUN apt-get update && apt-get install -y libtcl libtk RUN Rscript -e 'remotes::install_github("mmollina/mappoly")' -RUN Rscript -e 'remotes::install_github("Cristianetaniguti/Reads2MapApp" )' +RUN Rscript -e 'remotes::install_github("Cristianetaniguti/Reads2MapApp" )' EXPOSE 80 CMD ["R", "-e", "options('shiny.port'=80,shiny.host='0.0.0.0');Reads2MapApp::run_app()"] \ No newline at end of file diff --git a/R/graphics_emp.R b/R/graphics_emp.R index 6bc3c90..a1a8cd5 100644 --- a/R/graphics_emp.R +++ b/R/graphics_emp.R @@ -49,18 +49,20 @@ prepare_datas_emp <- function(x = NULL, example_emp = NULL){ software <- "onemap" for_rm <- sapply(list_files, "[", -grep("sequences",datas)) + datas <- lapply(datas,function(x) gsub("/$", "", x)) + # Support to several versions if(length(grep("sequences",datas)) > 1){ temp_dat <- list() idx <- grep("sequences",datas)[-1] for(i in 1:length(idx)){ - temp_dat[[i]] <- readRDS(gsub("/$", "", datas[[idx[i]]])) + temp_dat[[i]] <- readRDS(datas[[idx[i]]]) } names_rdatas <- basename(unlist(datas[idx])) } else { ext <- sapply(strsplit(basename(datas[[grep("sequences",datas)]]), "[.]"), function(x) x[length(x)]) if(ext == "llo") temp_dat <- largeList::readList(datas[[grep("sequences",datas)]]) else - temp_dat <- readRDS(gsub("/$", "", datas[[grep("sequences",datas)]])) + temp_dat <- readRDS(datas[[grep("sequences",datas)]]) names_rdatas <- vroom(datas[[grep("names.tsv.gz", datas)]], delim = "\t", show_col_types = FALSE) names_rdatas <- as.data.frame(names_rdatas)[,1] if(length(grep("gusmap", names_rdatas)) > 0){ @@ -277,4 +279,3 @@ SNPCalling_efficiency_graph_emp <- function(data, data_names){ scale_color_grey() + scale_fill_viridis_c() + theme_bw() + coord_sf(clip = "off") } - diff --git a/R/graphics_poly_emp.R b/R/graphics_poly_emp.R index a5740cb..92cfbfd 100644 --- a/R/graphics_poly_emp.R +++ b/R/graphics_poly_emp.R @@ -21,7 +21,6 @@ prepare_poly_datas_emp <- function(x = NULL, example_emp = NULL){ if(example_emp == "toy_sample_poly"){ data.gz <- system.file("ext", "toy_sample_emp/polyploid/EmpiricalReads_results.tar.gz", package = "Reads2MapApp") } - #data.gz <- "C:/Users/Rose_Lab/Documents/Cris_temp/GBS-test_results/EmpiricalReads_results.tar.gz" } if(data.gz == "Wait"){ @@ -47,6 +46,8 @@ prepare_poly_datas_emp <- function(x = NULL, example_emp = NULL){ datas[[i]] <- sapply(list_files, "[", i) } + datas <- lapply(datas,function(x) gsub("/$", "", x)) + software <- "mappoly" datas <- unlist(datas) list_items <- c("dat", "mat2", "map") @@ -57,8 +58,8 @@ prepare_poly_datas_emp <- function(x = NULL, example_emp = NULL){ temp_item <- list() for(i in 1:length(files)){ if(grepl("map", files[i]) & !grepl("0", files[i])){ - temp_item[[i]] <- list(readRDS(gsub("/$", "", files[i]))) - } else temp_item[[i]] <- readRDS(gsub("/$", "", files[i])) + temp_item[[i]] <- list(readRDS(files[i])) + } else temp_item[[i]] <- readRDS(files[i]) } } else temp_item <- NULL names(temp_item) <- sapply(strsplit(basename(files), "_"), function(x) paste0(x[1:3], collapse = "_"))