Last updated: 2021-06-10
Checks: 6 1
Knit directory: TNBC_Multi/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). 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(42)
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.
To ensure reproducibility of the results, delete the cache directory simple_misty_cache
and re-run the analysis. To have workflowr automatically delete the cache directory prior to building the file, set delete_cache = TRUE
when running wflow_build()
or wflow_publish()
.
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 7c0f47e. 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: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: .misty.temp/
Ignored: analysis/.DS_Store
Ignored: analysis/.Rhistory
Ignored: analysis/simple_misty_cache/
Ignored: code/
Ignored: data/
Ignored: output/
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/simple_misty.Rmd
) and HTML (docs/simple_misty.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 | 7c0f47e | Jovan Tanevski | 2021-06-10 | wflow_publish(all = TRUE) |
Rmd | eb056ff | Jovan Tanevski | 2021-06-10 | add simple misty analysis |
library(reticulate)
library(mistyR)
library(future)
sample <- 982
modality <- "codex"
use_python("/usr/local/bin/python3")
Requires python3
and anndata installed (pip install anndata
).
import anndata
path_template = "data/HTAPP-{0}-SMP-7629/HTAPP-{0}-SMP-7629_{1}_processed.h5ad"
adata = anndata.read(path_template.format(int(r.sample), r.modality))
counts = adata.obsm["counts"]
geom = adata.obs[["x_orig", "y_orig"]]
markers = adata.uns["counts_var"]
plan(multisession, workers = 6)
expr <- as.data.frame(as.matrix(py$counts))
colnames(expr) <- make.names(py$markers)
pos <- py$geom
misty.views <- create_initial_view(expr) %>%
add_juxtaview(pos) %>%
add_paraview(pos, 100)
Computing triangulation
Generating juxtaview
Generating paraview
run_misty(misty.views,
results.folder = paste0("output/", sample, "_", modality)
)
Training models
Warning in ...furrr_fn(...): Negative performance detected and replaced with 0
for target CTLA4
Warning in ...furrr_fn(...): Negative performance detected and replaced with 0
for target CD69
Warning in ...furrr_fn(...): Negative performance detected and replaced with 0
for target PDPN
Warning in ...furrr_fn(...): Negative performance detected and replaced with 0
for target CD38
[1] "/Users/jovant/Work/TNBC_Multi/output/982_codex"
misty.results <- collect_results(paste0("output/", sample, "_", modality))
Collecting improvements
Collecting contributions
Collecting importances
Aggregating
misty.results %>%
plot_improvement_stats() %>%
plot_view_contributions() %>%
plot_interaction_heatmap("intra", 2) %>%
plot_interaction_heatmap("juxta.15", 2) %>%
plot_interaction_heatmap("para.100", 2) %>%
plot_contrast_heatmap("intra", "juxta.15", 2) %>%
plot_contrast_heatmap("intra", "para.100", 2)
Warning: Removed 50 rows containing missing values (geom_segment).
sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] purrr_0.3.4 future_1.21.0 mistyR_1.0.2 reticulate_1.20
[5] workflowr_1.6.2
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 lattice_0.20-44 tidyr_1.1.3 listenv_0.8.0
[5] png_0.1-7 assertthat_0.2.1 rprojroot_2.0.2 digest_0.6.27
[9] utf8_1.2.1 parallelly_1.25.0 R6_2.5.0 evaluate_0.14
[13] highr_0.9 ggplot2_3.3.3 pillar_1.6.1 rlang_0.4.11
[17] whisker_0.4 furrr_0.2.2 jquerylib_0.1.4 R.utils_2.10.1
[21] R.oo_1.24.0 Matrix_1.3-4 rmarkdown_2.8 labeling_0.4.2
[25] readr_1.4.0 stringr_1.4.0 munsell_0.5.0 compiler_4.1.0
[29] httpuv_1.6.1 xfun_0.23 pkgconfig_2.0.3 globals_0.14.0
[33] htmltools_0.5.1.1 tidyselect_1.1.1 tibble_3.1.2 codetools_0.2-18
[37] fansi_0.5.0 crayon_1.4.1 dplyr_1.0.6 later_1.2.0
[41] R.methodsS3_1.8.1 grid_4.1.0 jsonlite_1.7.2 gtable_0.3.0
[45] lifecycle_1.0.0 DBI_1.1.1 git2r_0.28.0 magrittr_2.0.1
[49] scales_1.1.1 stringi_1.6.2 farver_2.1.0 fs_1.5.0
[53] promises_1.2.0.1 bslib_0.2.5.1 ellipsis_0.3.2 generics_0.1.0
[57] vctrs_0.3.8 RColorBrewer_1.1-2 tools_4.1.0 glue_1.4.2
[61] hms_1.1.0 parallel_4.1.0 yaml_2.2.1 colorspace_2.0-1
[65] knitr_1.33 sass_0.4.0