Last updated: 2024-07-19
Checks: 7 0
Knit directory: KODAMA-Analysis/
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(20240618)
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 3f7aad6. 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:
Unstaged changes:
Deleted: analysis/figure/DLPFC-12.Rmd/unnamed-chunk-10-1.png
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/VisiumHD.Rmd
) and HTML
(docs/VisiumHD.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 | 5b97082 | tkcaccia | 2024-07-15 | updates |
Rmd | 7be8f59 | tkcaccia | 2024-07-15 | updates |
html | 7be8f59 | tkcaccia | 2024-07-15 | updates |
Rmd | 79f73a2 | GitHub | 2024-07-14 | Update VisiumHD.Rmd |
html | f8ca54a | tkcaccia | 2024-07-14 | update |
html | d04c1e7 | GitHub | 2024-07-08 | Update VisiumHD.html |
html | 754c8bf | GitHub | 2024-07-04 | Update VisiumHD.html |
html | ee4ee17 | GitHub | 2024-06-19 | Add files via upload |
Rmd | 615fc05 | GitHub | 2024-06-19 | Add files via upload |
Describe your project. The data can be downloaded using the following script: VisiumHD_CRC_download.sh. This script facilitates access to the raw data, which will then be preprocessed and analyzed in the subsequent steps of our pipeline.
The data can be downloaded using the following script: VisiumHD_CRC_download.sh. This script facilitates access to the raw data, which will then be preprocessed and analyzed in the subsequent steps of our pipeline.
library("ggplot2")
library("patchwork")
library("dplyr")
library("Seurat")
localdir="../Colorectal/outs/"
object <- Load10X_Spatial(data.dir = localdir, bin.size = c(8))
vln.plot <- VlnPlot(object, features = "nCount_Spatial.008um", pt.size = 0) + NoLegend()
count.plot <- SpatialFeaturePlot(object, features = "nCount_Spatial.008um", pt.size.factor = 1.2) +
theme(legend.position = "right")
nCount_Spatial=colSums(object@assays$Spatial.008um$counts)
#w= which(nCount_Spatial >10)
#object@assays$Spatial.008um$counts= object@assays$Spatial.008um$counts[,w]
#object@meta.data=object@meta.data[w,]
sp_obj <- subset(
object,
subset = nCount_Spatial.008um > 100)
nCount_Spatial=colSums(sp_obj@assays$Spatial.008um$counts)
counts=sp_obj@assays$Spatial.008um$counts
is_mito <- grepl("(^MT-)|(^mt-)", rownames(counts))
counts <- counts[!is_mito,]
filter_genes_ncounts=1
filter_genes_pcspots=0.5
nspots <- ceiling(filter_genes_pcspots/100 * ncol(counts))
ix_remove <- rowSums(counts >= filter_genes_ncounts) < nspots
counts <- counts[!ix_remove,]
QCgenes <- rownames(counts)
VariableFeatures(sp_obj) = QCgenes
rm(counts)
DefaultAssay(sp_obj) <- "Spatial.008um"
sp_obj <- NormalizeData(sp_obj)
sp_obj <- FindVariableFeatures(sp_obj)
sp_obj <- ScaleData(sp_obj)
xy=as.matrix(GetTissueCoordinates(sp_obj))
sp_obj <- RunPCA(sp_obj, reduction.name = "pca.008um")
dim(sp_obj)
[1] 18085 428381
plot(Seurat::Embeddings(sp_obj, reduction = "pca.008um"))
Version | Author | Date |
---|---|---|
7be8f59 | tkcaccia | 2024-07-15 |
sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 20.04.6 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Etc/UTC
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Seurat_5.1.0 SeuratObject_5.0.2 sp_2.1-4 dplyr_1.1.4
[5] patchwork_1.2.0 ggplot2_3.5.1 workflowr_1.7.1
loaded via a namespace (and not attached):
[1] RColorBrewer_1.1-3 rstudioapi_0.16.0 jsonlite_1.8.8
[4] magrittr_2.0.3 ggbeeswarm_0.7.2 spatstat.utils_3.0-5
[7] farver_2.1.2 rmarkdown_2.27 fs_1.6.4
[10] vctrs_0.6.5 ROCR_1.0-11 spatstat.explore_3.3-1
[13] htmltools_0.5.8.1 sass_0.4.9 sctransform_0.4.1
[16] parallelly_1.37.1 KernSmooth_2.23-24 bslib_0.7.0
[19] htmlwidgets_1.6.4 ica_1.0-3 plyr_1.8.9
[22] plotly_4.10.4 zoo_1.8-12 cachem_1.1.0
[25] whisker_0.4.1 igraph_2.0.3 mime_0.12
[28] lifecycle_1.0.4 pkgconfig_2.0.3 Matrix_1.7-0
[31] R6_2.5.1 fastmap_1.2.0 fitdistrplus_1.2-1
[34] future_1.33.2 shiny_1.8.1.1 digest_0.6.36
[37] colorspace_2.1-0 ps_1.7.7 rprojroot_2.0.4
[40] tensor_1.5 RSpectra_0.16-1 irlba_2.3.5.1
[43] progressr_0.14.0 fansi_1.0.6 spatstat.sparse_3.1-0
[46] httr_1.4.7 polyclip_1.10-6 abind_1.4-5
[49] compiler_4.4.1 bit64_4.0.5 withr_3.0.0
[52] fastDummies_1.7.3 highr_0.11 MASS_7.3-61
[55] tools_4.4.1 vipor_0.4.7 lmtest_0.9-40
[58] beeswarm_0.4.0 httpuv_1.6.15 future.apply_1.11.2
[61] goftest_1.2-3 glue_1.7.0 callr_3.7.6
[64] nlme_3.1-165 promises_1.3.0 grid_4.4.1
[67] Rtsne_0.17 getPass_0.2-4 cluster_2.1.6
[70] reshape2_1.4.4 generics_0.1.3 hdf5r_1.3.11
[73] gtable_0.3.5 spatstat.data_3.1-2 tidyr_1.3.1
[76] data.table_1.15.4 utf8_1.2.4 spatstat.geom_3.3-2
[79] RcppAnnoy_0.0.22 ggrepel_0.9.5 RANN_2.6.1
[82] pillar_1.9.0 stringr_1.5.1 spam_2.10-0
[85] RcppHNSW_0.6.0 later_1.3.2 splines_4.4.1
[88] lattice_0.22-6 bit_4.0.5 survival_3.7-0
[91] deldir_2.0-4 tidyselect_1.2.1 miniUI_0.1.1.1
[94] pbapply_1.7-2 knitr_1.48 git2r_0.33.0
[97] gridExtra_2.3 scattermore_1.2 xfun_0.45
[100] matrixStats_1.3.0 stringi_1.8.4 lazyeval_0.2.2
[103] yaml_2.3.9 evaluate_0.24.0 codetools_0.2-20
[106] tibble_3.2.1 cli_3.6.3 uwot_0.2.2
[109] arrow_16.1.0 xtable_1.8-4 reticulate_1.38.0
[112] munsell_0.5.1 processx_3.8.4 jquerylib_0.1.4
[115] Rcpp_1.0.12 globals_0.16.3 spatstat.random_3.3-1
[118] png_0.1-8 ggrastr_1.0.2 spatstat.univar_3.0-0
[121] parallel_4.4.1 assertthat_0.2.1 dotCall64_1.1-1
[124] listenv_0.9.1 viridisLite_0.4.2 scales_1.3.0
[127] ggridges_0.5.6 leiden_0.4.3.1 purrr_1.0.2
[130] rlang_1.1.4 cowplot_1.1.3