Last updated: 2025-01-20

Checks: 7 0

Knit directory: mi_spatialomics/

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


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

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(20230612) 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.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

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 39f7f26. 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/
    Ignored:    analysis/.DS_Store
    Ignored:    data/.DS_Store
    Ignored:    data/Traditional_IF_absolute_cell_counts.csv
    Ignored:    data/Traditional_IF_relative_cell_counts.csv
    Ignored:    data/seqIF_regions_annotations/
    Ignored:    output/.DS_Store
    Ignored:    output/mol_cart.harmony_object.h5Seurat
    Ignored:    output/molkart/
    Ignored:    output/proteomics/
    Ignored:    output/results_cts.lowres.125.sqm
    Ignored:    output/seqIF/
    Ignored:    plots/
    Ignored:    renv/.DS_Store
    Ignored:    renv/library/
    Ignored:    renv/staging/

Untracked files:
    Untracked:  analysis/SeqIF.lumen_distance_calculations.Rmd
    Untracked:  review/cell_table_final_lumen_bins_plot.csv
    Untracked:  review/cell_table_final_lumen_bins_plot_grouped.csv

Unstaged changes:
    Modified:   analysis/endocardial_cell_definition.Rmd
    Modified:   analysis/index.Rmd

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/figures.Figure3.Rmd) and HTML (docs/figures.Figure3.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
Rmd 5e3046c FloWuenne 2024-12-15 Updated Figure 3 and Supp Figure 7 with new region quantifications.
Rmd 6478404 FloWuenne 2024-12-03 Updated Supp Figure 5 and added celltype analysis markdown R1-1 and Figure 3 R2-4.
html a2cf304 FloWuenne 2024-03-21 Build site.
Rmd e6213a5 FloWuenne 2024-03-21 Publish all updated files.
Rmd 56559c7 FloWuenne 2024-03-21 Cleaned up repository.
Rmd 21b927e FloWuenne 2024-03-17 Updates supplementary figure code.

Introduction

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(data.table)
Warning: package 'data.table' was built under R version 4.3.3

Attaching package: 'data.table'

The following objects are masked from 'package:lubridate':

    hour, isoweek, mday, minute, month, quarter, second, wday, week,
    yday, year

The following objects are masked from 'package:dplyr':

    between, first, last

The following object is masked from 'package:purrr':

    transpose
library(ggbeeswarm)

source("./code/functions.R")

Attaching package: 'cowplot'

The following object is masked from 'package:lubridate':

    stamp
Warning: package 'ggsci' was built under R version 4.3.3
here() starts at /Users/florian_wuennemann/1_Projects/MI_project/1_Manuscript/Review_NCVR/mi_spatialomics
## Read in quantified data
all_cell_types_quantified <- fread("./review/all_cell_types_per_region_counts_perctentages_20241212.csv")

ccr2_monomacro <- all_cell_types_quantified %>%
  subset(final_cell_type == "Mono / Macros Ccr2+") %>%
  subset(timepoint %in% c("4h","24h","48h")) %>%
  subset(region_name %in% c("border_zone","infarct_core","epicardial_region","endocardial_region"))

ccr2_monomacro$region_name <- gsub("border_zone","Border zone",ccr2_monomacro$region_name)
ccr2_monomacro$region_name <- gsub("infarct_core","Infarct core",ccr2_monomacro$region_name)
ccr2_monomacro$region_name <- gsub("epicardial_region","Epicardium",ccr2_monomacro$region_name)
ccr2_monomacro$region_name <- gsub("endocardial_region","Endocardium",ccr2_monomacro$region_name)

ccr2_monomacro$region_name <- factor(ccr2_monomacro$region_name,
                             levels = c("Endocardium","Infarct core","Epicardium","Border zone"))
ccr2_monomacro$timepoint <- factor(ccr2_monomacro$timepoint,
                             levels = c("4h","24h","48h"))

seqIF_ccr2_relquant <- ggplot(ccr2_monomacro,aes(x = timepoint,y = count_per_mm2)) +
    stat_summary(
      fun.y = mean,
      geom = "bar",
      width = 0.9,
      size = 0.3,
      color = "black",
      fill = "lightgrey") +
  geom_beeswarm(size = 2, pch = 21, color = "black", aes(fill = region_name)) +
  labs(x = "Time",
         y = expression("Cells /"~mm^2)) + 
  #expression(paste("Mo / M",phi," per "~mm^2))
  facet_grid(. ~ region_name) +
  scale_fill_manual(values = c("#337272","#f0f0f0","#b062c2","#2c95c5")) +
  theme(axis.title = element_text(face="bold"),
        legend.position = "none") +
  theme(panel.border = element_rect(color = "black", fill = NA, size = 0.75)) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1),
        axis.title.x = element_blank()) 
Warning: The `fun.y` argument of `stat_summary()` is deprecated as of ggplot2 3.3.0.
ℹ Please use the `fun` argument instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
generated.
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
generated.
Warning: The `size` argument of `element_rect()` is deprecated as of ggplot2 3.4.0.
ℹ Please use the `linewidth` argument instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
generated.
seqIF_ccr2_relquant

save_plot(filename = "./plots/Figure_3.SeqIF-absolute_cell_counts.pdf",
           plot = seqIF_ccr2_relquant,
           base_asp = 1.8,
           base_height = 3)

<br>
<p>
<button type="button" class="btn btn-default btn-workflowr btn-workflowr-sessioninfo"
  data-toggle="collapse" data-target="#workflowr-sessioninfo"
  style = "display: block;">
  <span class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
  Session information
</button>
</p>

<div id="workflowr-sessioninfo" class="collapse">

``` r
sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.1.2

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Toronto
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
 [1] RColorBrewer_1.1-3 here_1.0.1         ggsci_3.2.0        cowplot_1.1.3     
 [5] ggbeeswarm_0.7.2   data.table_1.16.2  lubridate_1.9.3    forcats_1.0.0     
 [9] stringr_1.5.1      dplyr_1.1.4        purrr_1.0.2        readr_2.1.5       
[13] tidyr_1.3.1        tibble_3.2.1       ggplot2_3.5.1      tidyverse_2.0.0   
[17] workflowr_1.7.1   

loaded via a namespace (and not attached):
 [1] gtable_0.3.6        beeswarm_0.4.0      xfun_0.49          
 [4] bslib_0.8.0         processx_3.8.4      callr_3.7.6        
 [7] tzdb_0.4.0          vctrs_0.6.5         tools_4.3.1        
[10] ps_1.8.1            generics_0.1.3      fansi_1.0.6        
[13] pkgconfig_2.0.3     lifecycle_1.0.4     farver_2.1.2       
[16] compiler_4.3.1      git2r_0.35.0        textshaping_0.4.0  
[19] munsell_0.5.1       getPass_0.2-4       vipor_0.4.7        
[22] httpuv_1.6.15       htmltools_0.5.8.1   sass_0.4.9         
[25] yaml_2.3.10         crayon_1.5.3        later_1.4.1        
[28] pillar_1.9.0        jquerylib_0.1.4     whisker_0.4.1      
[31] cachem_1.1.0        tidyselect_1.2.1    digest_0.6.37      
[34] stringi_1.8.4       labeling_0.4.3      rprojroot_2.0.4    
[37] fastmap_1.2.0       grid_4.3.1          colorspace_2.1-1   
[40] cli_3.6.3           magrittr_2.0.3      utf8_1.2.4         
[43] withr_3.0.2         scales_1.3.0        promises_1.3.2     
[46] timechange_0.3.0    rmarkdown_2.29      httr_1.4.7         
[49] ragg_1.3.3          hms_1.1.3           evaluate_1.0.1     
[52] knitr_1.49          rlang_1.1.4         Rcpp_1.0.13-1      
[55] glue_1.8.0          BiocManager_1.30.25 renv_1.0.3         
[58] rstudioapi_0.17.1   jsonlite_1.8.9      R6_2.5.1           
[61] systemfonts_1.1.0   fs_1.6.5