Last updated: 2024-08-27

Checks: 5 2

Knit directory: ieny_2024_spatial-rna-graphs/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20240820) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Using absolute paths to the files within your workflowr project makes it difficult for you and others to run your code on a different machine. Change the absolute path(s) below to the suggested relative path(s) to make your code more reproducible.

absolute relative
/mnt/beegfs/mccarthy/backed_up/general/rlyu/Projects/ieny_2024_spatial-rna-graphs .

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 7d0ce41. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rproj.user/

Untracked files:
    Untracked:  .Renviron
    Untracked:  .gitignore
    Untracked:  .snakemake/
    Untracked:  analysis/2024-08-13_hyper_parameters.Rmd
    Untracked:  analysis/2024-08-13_hyper_parameters.html
    Untracked:  analysis/2024-08-22_hyper_parameters_hsize_batch_size_edges_radius.Rmd
    Untracked:  analysis/about.Rmd
    Untracked:  analysis/index.Rmd
    Untracked:  analysis/license.Rmd
    Untracked:  code/datasets/__pycache__/
    Untracked:  code/expl_metrics.R
    Untracked:  code/gen_umap.R
    Untracked:  code/plot_acc.R
    Untracked:  code/plot_acc_10epochARI.R
    Untracked:  code/plot_acc_incell_edges_only.R
    Untracked:  code/plot_acc_increaseBatchARI.R
    Untracked:  code/plot_acc_increaseBatchEpochARI.R
    Untracked:  code/plot_acc_increaseEpoch.R
    Untracked:  code/plot_acc_increaseEpochARI.R
    Untracked:  code/plot_acc_largerNet.R
    Untracked:  code/plot_acc_stable_train_largeEdges_ARI.R
    Untracked:  code/plot_acc_testShuffle.R
    Untracked:  code/plot_acc_test_disjointARI.R
    Untracked:  code/plot_sil_score.R
    Untracked:  code/plot_sil_score_largeNet.R
    Untracked:  code/plot_sil_score_largebatch.R
    Untracked:  code/plot_train_test_loss.R
    Untracked:  code/plot_umaps_agg.R
    Untracked:  code/run_check.py
    Untracked:  code/run_test_loss.py
    Untracked:  code/run_tile_lung_tissue_spatialRNA.py
    Untracked:  code/run_training_correct_large_edges.py
    Untracked:  code/run_training_correct_large_edges_batchx.py
    Untracked:  code/run_training_correct_large_edges_sm_batch.py
    Untracked:  code/run_training_disjoint.py
    Untracked:  code/run_training_dmax.py
    Untracked:  code/run_training_dmax10epoch.py
    Untracked:  code/run_training_dmax_largeBatch.py
    Untracked:  code/run_training_dmax_largeBatch_moreEpoch.py
    Untracked:  code/run_training_dmax_moreEpoch.py
    Untracked:  code/run_training_dmax_moreneighbours.py
    Untracked:  code/run_training_largeB10epoch.py
    Untracked:  code/run_training_largerNet.py
    Untracked:  code/run_training_selfloop.py
    Untracked:  code/run_training_shuffle.py
    Untracked:  code/run_training_test_large_edges_batchx_hsize.py
    Untracked:  code/run_training_with_incell_edges.py
    Untracked:  code/tests/
    Untracked:  data/
    Untracked:  envs/install-packages.md
    Untracked:  gen_sim/dense1/
    Untracked:  gen_sim/dense2/
    Untracked:  gen_sim/dense4/
    Untracked:  gen_sim/simulated/data/analysis/
    Untracked:  gen_sim/simulated/data/batched.matrix.tsv.gz
    Untracked:  gen_sim/simulated/data/cell_info.tsv.gz
    Untracked:  gen_sim/simulated/data/coordinate_minmax.tsv
    Untracked:  gen_sim/simulated/data/feature.tsv.gz
    Untracked:  gen_sim/simulated/data/hexagon.d_12.s_2.tsv.gz
    Untracked:  gen_sim/simulated/data/matrix.csv
    Untracked:  gen_sim/simulated/data/matrix.tsv.gz
    Untracked:  gen_sim/simulated/data/model.rgb.tsv
    Untracked:  gen_sim/simulated/data/model.true.tsv.gz
    Untracked:  gen_sim/simulated/data/pixel_label.uniq.tsv.gz
    Untracked:  gen_sim/simulated/data/processed/
    Untracked:  gen_sim/simulated/data/raw/
    Untracked:  gen_sim/simulated/data/subgraph/
    Untracked:  gen_sim/simulated/emb_models/
    Untracked:  gen_sim/simulated/embs.npy
    Untracked:  gen_sim/simulated/embs_pytorchversion.npy
    Untracked:  gen_sim/simulated/embs_pytorchversion_dmax1.npy
    Untracked:  gen_sim/simulated_rec/
    Untracked:  ieny_2024_spatial-rna-graphs.Rproj
    Untracked:  output/
    Untracked:  requirements_kernel.txt
    Untracked:  tutorial_notebooks/.ipynb_checkpoints/
    Untracked:  tutorial_notebooks/check_gat.ipynb
    Untracked:  tutorial_notebooks/check_mem_usage.ipynb
    Untracked:  tutorial_notebooks/clustering_analysis.ipynb
    Untracked:  tutorial_notebooks/demo_overfit.ipynb
    Untracked:  tutorial_notebooks/expl_grad_multi_scale.ipynb
    Untracked:  tutorial_notebooks/expl_simulated_data_pytorch_versions_experimen.ipynb
    Untracked:  tutorial_notebooks/reproduciable_expl_simulated_data_pytorch_versions.ipynb
    Untracked:  tutorial_notebooks/stopping_cri.ipynb
    Untracked:  tutorial_notebooks/test_SpatialRNA.ipynb
    Untracked:  tutorial_notebooks/test_SpatialRNA_large_radius.ipynb
    Untracked:  tutorial_notebooks/test_batch_from_data_list.ipynb
    Untracked:  tutorial_notebooks/test_remote_backend.ipynb
    Untracked:  workflows/

Unstaged changes:
    Modified:   README.md
    Modified:   analysis/2024-08-20_hyper_parameters.Rmd
    Modified:   code/datasets/SpatialRNA.py
    Modified:   envs/environment.yml
    Deleted:    tutorial_notebooks/03_2_expl_integration_multiple_sample_increase_r.ipynb
    Modified:   tutorial_notebooks/05_scale_to_a_real_sample_SpatialRNA.ipynb

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/2024-08-22_hyper_parameters_hsize_batch_size_edges_radius.Rmd) and HTML (public/2024-08-22_hyper_parameters_hsize_batch_size_edges_radius.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
html 7d0ce41 rlyu 2024-08-27 full image figures
html 65da68d rlyu 2024-08-27 full image

#.libPaths()
#setwd("/mnt/beegfs/mccarthy/backed_up/general/rlyu/Projects/ieny_2024_spatial-rna-graphs")
.libPaths( "/mnt/beegfs/mccarthy/backed_up/general/rlyu/Software/Rlibs/4.1.2")
suppressPackageStartupMessages({
  library(readr)
  library(ggplot2)
  library(plotly)
  library(dplyr)
}) 
#getwd()

All testing results

all_res <- list.files("output/stable_train_gpu",
                      pattern = "ari_r.*.csv",
                      recursive = TRUE,full.names = T)

#length(all_res)
all_res <- sapply(all_res, function(x){ length(strsplit(x,"/")[[1]])})
all_res <- all_res[all_res ==7 ]
#length(all_res)
all_res <- names(all_res)
acc_results <- lapply(all_res,
                      function(file_name){
                        nedges = strsplit(file_name,"/")[[1]][3]
                        batch_size = strsplit(file_name,"/")[[1]][4]
                        h_size = strsplit(file_name,"/")[[1]][5]
                        radius = strsplit(file_name,"/")[[1]][7]
                        rep = strsplit(file_name,"/")[[1]][6]
                        
                        acc_res = read.csv(file_name,header = 1,col.names = c("id","ari"))
                        acc_res$nedges = nedges
                        acc_res$rep = rep
                        acc_res$h_size = h_size
                        acc_res$batch_size = batch_size
                        acc_res$radius <- radius
                        acc_res[1:3,"id"] <- paste0("all_",acc_res[1:3,"id"])
                        acc_res[4:6,"id"] <- paste0("cell_",acc_res[4:6,"id"])
                        acc_res$type = c("all","all","all","cell","cell","cell")
                        acc_res
                      })
acc_results_df <- do.call(rbind,acc_results)
acc_results_df$nedges <- as.numeric(gsub("nedges","",
                                                     acc_results_df$nedges))

acc_results_df$radius <- gsub("ari_","",
                                          acc_results_df$radius)
acc_results_df$radius <- gsub(".csv","",
                                          acc_results_df$radius)

Full image

p1 <- acc_results_df %>% 
    group_by(type,radius,nedges,rep,h_size,batch_size) %>% 
  arrange(-ari) %>% 
  slice(1) %>%
  mutate(batch_size = factor(batch_size,  
                             levels = c("batchsize100", "batchsize500",
                                        "batchsize1024","batchsize2048" ))) %>%
  mutate(h_size = factor(h_size,  
                             levels = c( "hsize30","hsize50",
                                         "hsize100","hsize150"  ))) %>%
  
  ggplot()+
  geom_boxplot(mapping = aes(x = batch_size, 
                             y = ari,fill=type),
               outlier.shape = 12)+
  geom_jitter(mapping = aes(x = batch_size, 
                            y = ari),height = 0,
              size=0.1)+
  geom_hline(mapping=aes(yintercept=0.9),
             linetype="dashed")+
  facet_grid(cols = vars(nedges),rows = vars(radius,h_size),
             scales = "free_x",
             space="free_x")+
  theme_bw(base_size = 10)+
  theme(axis.text.x = element_text(angle = 90),
        axis.title.x = element_blank())
p1

Version Author Date
97551da rlyu 2024-08-27
p_r1 <- acc_results_df %>% 
    group_by(type,radius,nedges,rep,h_size,batch_size) %>% 
  arrange(-ari) %>% 
  slice(1) %>%
  filter(radius=="r1") %>%
  mutate(batch_size = factor(batch_size,  
                             levels = c("batchsize100", "batchsize500",
                                        "batchsize1024","batchsize2048" ))) %>%
  mutate(h_size = factor(h_size,  
                             levels = c( "hsize30","hsize50",
                                         "hsize100","hsize150"  ))) %>%
  
  ggplot()+
  geom_boxplot(mapping = aes(x = batch_size, 
                             y = ari,fill=type),
               outlier.shape = 12)+
  geom_jitter(mapping = aes(x = batch_size, 
                            y = ari),height = 0,
              size=0.1)+
  geom_hline(mapping=aes(yintercept=0.9),
             linetype="dashed")+
  facet_grid(cols = vars(nedges),rows = vars(radius,h_size),
             scales = "free_x",
             space="free_x")+
  theme_bw(base_size = 10)+
  theme(axis.text.x = element_text(angle = 90),
        axis.title.x = element_blank())
p_r3 <- acc_results_df %>% 
    group_by(type,radius,nedges,rep,h_size,batch_size) %>% 
  arrange(-ari) %>% 
  slice(1) %>%
  filter(radius=="r3") %>%
  mutate(batch_size = factor(batch_size,  
                             levels = c("batchsize100", "batchsize500",
                                        "batchsize1024","batchsize2048" ))) %>%
  mutate(h_size = factor(h_size,  
                             levels = c( "hsize30","hsize50",
                                         "hsize100","hsize150"  ))) %>%
  
  ggplot()+
  geom_boxplot(mapping = aes(x = batch_size, 
                             y = ari,fill=type),
               outlier.shape = 12)+
  geom_jitter(mapping = aes(x = batch_size, 
                            y = ari),height = 0,
              size=0.1)+
  geom_hline(mapping=aes(yintercept=0.9),
             linetype="dashed")+
  facet_grid(cols = vars(nedges),rows = vars(radius,h_size),
             scales = "free_x",
             space="free_x")+
  theme_bw(base_size = 10)+
  theme(axis.text.x = element_text(angle = 90),
        axis.title.x = element_blank())
p_r6 <- acc_results_df %>% 
    group_by(type,radius,nedges,rep,h_size,batch_size) %>% 
  arrange(-ari) %>% 
  slice(1) %>%
  filter(radius=="r6") %>%
  mutate(batch_size = factor(batch_size,  
                             levels = c("batchsize100", "batchsize500",
                                        "batchsize1024","batchsize2048" ))) %>%
  mutate(h_size = factor(h_size,  
                             levels = c( "hsize30","hsize50",
                                         "hsize100","hsize150"  ))) %>%
  
  ggplot()+
  geom_boxplot(mapping = aes(x = batch_size, 
                             y = ari,fill=type),
               outlier.shape = 12)+
  geom_jitter(mapping = aes(x = batch_size, 
                            y = ari),height = 0,
              size=0.1)+
  geom_hline(mapping=aes(yintercept=0.9),
             linetype="dashed")+
  facet_grid(cols = vars(nedges),rows = vars(radius,h_size),
             scales = "free_x",
             space="free_x")+
  theme_bw(base_size = 10)+
  theme(axis.text.x = element_text(angle = 90),
        axis.title.x = element_blank())

radius r1 image

p_r1

Version Author Date
97551da rlyu 2024-08-27
p_r3

Version Author Date
97551da rlyu 2024-08-27
p_r6

Version Author Date
97551da rlyu 2024-08-27

devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       Rocky Linux 8.10 (Green Obsidian)
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_AU.UTF-8
 ctype    en_AU.UTF-8
 tz       Australia/Melbourne
 date     2024-08-27
 pandoc   3.1.1 @ /usr/lib/rstudio-server/bin/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 brio          1.1.3   2021-11-30 [1] CRAN (R 4.1.2)
 bslib         0.5.1   2023-08-11 [1] CRAN (R 4.1.2)
 cachem        1.0.8   2023-05-01 [1] CRAN (R 4.1.2)
 callr         3.7.0   2021-04-20 [1] CRAN (R 4.1.2)
 cli           3.6.1   2023-03-23 [1] CRAN (R 4.1.2)
 colorspace    2.1-0   2023-01-23 [1] CRAN (R 4.1.2)
 crayon        1.5.2   2022-09-29 [1] CRAN (R 4.1.2)
 data.table    1.14.8  2023-02-17 [1] CRAN (R 4.1.2)
 desc          1.4.1   2022-03-06 [1] CRAN (R 4.1.2)
 devtools      2.4.3   2021-11-30 [1] CRAN (R 4.1.2)
 digest        0.6.33  2023-07-07 [1] CRAN (R 4.1.2)
 dplyr       * 1.1.3   2023-09-03 [1] CRAN (R 4.1.2)
 ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.1.2)
 evaluate      0.23    2023-11-01 [1] CRAN (R 4.1.2)
 fansi         1.0.5   2023-10-08 [1] CRAN (R 4.1.2)
 farver        2.1.1   2022-07-06 [1] CRAN (R 4.1.2)
 fastmap       1.1.1   2023-02-24 [1] CRAN (R 4.1.2)
 fs            1.6.3   2023-07-20 [1] CRAN (R 4.1.2)
 generics      0.1.3   2022-07-05 [1] CRAN (R 4.1.2)
 ggplot2     * 3.4.4   2023-10-12 [1] CRAN (R 4.1.2)
 git2r         0.29.0  2021-11-22 [1] CRAN (R 4.1.2)
 glue          1.6.2   2022-02-24 [1] CRAN (R 4.1.2)
 gtable        0.3.4   2023-08-21 [1] CRAN (R 4.1.2)
 highr         0.10    2022-12-22 [1] CRAN (R 4.1.2)
 hms           1.1.2   2022-08-19 [1] CRAN (R 4.1.2)
 htmltools     0.5.7   2023-11-03 [1] CRAN (R 4.1.2)
 htmlwidgets   1.6.2   2023-03-17 [1] CRAN (R 4.1.2)
 httpuv        1.6.12  2023-10-23 [1] CRAN (R 4.1.2)
 httr          1.4.7   2023-08-15 [1] CRAN (R 4.1.2)
 jquerylib     0.1.4   2021-04-26 [1] CRAN (R 4.1.2)
 jsonlite      1.8.7   2023-06-29 [1] CRAN (R 4.1.2)
 knitr         1.45    2023-10-30 [1] CRAN (R 4.1.2)
 labeling      0.4.3   2023-08-29 [1] CRAN (R 4.1.2)
 later         1.3.1   2023-05-02 [1] CRAN (R 4.1.2)
 lazyeval      0.2.2   2019-03-15 [1] CRAN (R 4.1.2)
 lifecycle     1.0.3   2022-10-07 [1] CRAN (R 4.1.2)
 magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.1.2)
 memoise       2.0.1   2021-11-26 [1] CRAN (R 4.1.2)
 munsell       0.5.0   2018-06-12 [1] CRAN (R 4.1.2)
 pillar        1.9.0   2023-03-22 [1] CRAN (R 4.1.2)
 pkgbuild      1.3.1   2021-12-20 [1] CRAN (R 4.1.2)
 pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.1.2)
 pkgload       1.2.4   2021-11-30 [1] CRAN (R 4.1.2)
 plotly      * 4.10.4  2024-01-13 [1] CRAN (R 4.1.2)
 prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.1.2)
 processx      3.5.2   2021-04-30 [1] CRAN (R 4.1.2)
 promises      1.2.1   2023-08-10 [1] CRAN (R 4.1.2)
 ps            1.6.0   2021-02-28 [1] CRAN (R 4.1.2)
 purrr         1.0.2   2023-08-10 [1] CRAN (R 4.1.2)
 R6            2.5.1   2021-08-19 [1] CRAN (R 4.1.2)
 Rcpp          1.0.11  2023-07-06 [1] CRAN (R 4.1.2)
 readr       * 2.1.3   2022-10-01 [1] CRAN (R 4.1.2)
 remotes       2.4.2   2021-11-30 [1] CRAN (R 4.1.2)
 rlang         1.1.2   2023-11-04 [1] CRAN (R 4.1.2)
 rmarkdown     2.25    2023-09-18 [1] CRAN (R 4.1.2)
 rprojroot     2.0.3   2022-04-02 [1] CRAN (R 4.1.2)
 rstudioapi    0.13    2020-11-12 [1] CRAN (R 4.1.2)
 sass          0.4.7   2023-07-15 [1] CRAN (R 4.1.2)
 scales        1.3.0   2023-11-28 [1] CRAN (R 4.1.2)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.1.2)
 stringi       1.7.12  2023-01-11 [1] CRAN (R 4.1.2)
 stringr       1.5.0   2022-12-02 [1] CRAN (R 4.3.0)
 testthat      3.1.2   2022-01-20 [1] CRAN (R 4.1.2)
 tibble        3.2.1   2023-03-20 [1] CRAN (R 4.1.2)
 tidyr         1.3.0   2023-01-24 [1] CRAN (R 4.3.0)
 tidyselect    1.2.0   2022-10-10 [1] CRAN (R 4.1.2)
 tzdb          0.4.0   2023-05-12 [1] CRAN (R 4.1.2)
 usethis       2.1.6   2022-05-25 [1] CRAN (R 4.1.2)
 utf8          1.2.4   2023-10-22 [1] CRAN (R 4.1.2)
 vctrs         0.6.4   2023-10-12 [1] CRAN (R 4.1.2)
 viridisLite   0.4.2   2023-05-02 [1] CRAN (R 4.1.2)
 whisker       0.4     2019-08-28 [1] CRAN (R 4.1.2)
 withr         2.5.2   2023-10-30 [1] CRAN (R 4.1.2)
 workflowr     1.7.0   2021-12-21 [1] CRAN (R 4.1.2)
 xfun          0.41    2023-11-01 [1] CRAN (R 4.1.2)
 yaml          2.3.7   2023-01-23 [1] CRAN (R 4.1.2)

 [1] /mnt/beegfs/mccarthy/backed_up/general/rlyu/Software/Rlibs/4.1.2
 [2] /opt/R/4.1.2/lib/R/library

──────────────────────────────────────────────────────────────────────────────