knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
## For links library("BiocStyle") ## Track time spent on making the vignette startTime <- Sys.time() ## Bib setup library("RefManageR") ## Write bibliography information bib <- c( R = citation(), BiocStyle = citation("BiocStyle")[1], knitr =bibentry( bibtype = "InCollection", booktitle = "Implementing Reproducible Computational Research", title = "knitr: A Comprehensive Tool for Reproducible Research in R", author = as.person("Yihui Xie [aut]"), editor = as.person("Victoria Stodden, Friedrich Leisch, Roger D. Peng"), year = "2014", publisher = "Chapman and Hall/CRC", isbn = "978-1466561595", url = "https://www.routledge.com/Implementing-Reproducible-Research/Stodden-Leisch-Peng/p/book/9781466561595" ), Matrix = citation("Matrix")[1], RefManageR = citation("RefManageR")[1], rmarkdown = citation("rmarkdown")[1], S4Vectors = citation("S4Vectors")[1], sessioninfo = citation("sessioninfo")[1] )
Welcome to the SRTsim project! It is composed of:
The web application allows you to design spatial pattern and generate SRT data with patterns of interest.
SRTsimR is an open-source statistical environment which can be easily modified to enhance its functionality via packages. r CRANpkg('SRTsim') is a R package available via CRAN. R can be installed on any operating system from CRAN after which you can install r CRANpkg('SRTsim') by using the following commands in your R session:
install.packages("SRTsim")
To get started, please load the r CRANpkg('SRTsim') package.
library("SRTsim")
Once you have installed the package, we can perform reference-based Tissue-wise simulation with the example data.
## explore example SRT data str(exampleLIBD) example_count <- exampleLIBD$count example_loc <- exampleLIBD$info[,c("imagecol","imagerow","layer")] colnames(example_loc) <- c("x","y","label") ## create a SRT object simSRT <- createSRT(count_in=example_count,loc_in =example_loc) ## Set a seed for reproducible simulation set.seed(1) ## Estimate model parameters for data generation simSRT1 <- srtsim_fit(simSRT,sim_schem="tissue") ## Generate synthetic data with estimated parameters simSRT1 <- srtsim_count(simSRT1) ## Explore the synthetic data simCounts(simSRT1)[1:5,1:5] simcolData(simSRT1)
We can perform reference-based Domain-specific simulation with the example data.
## Set a seed for reproducible simulation set.seed(1) ## Estimate model parameters for data generation simSRT2 <- srtsim_fit(simSRT,sim_scheme='domain') ## Generate synthetic data with estimated parameters simSRT2 <- srtsim_count(simSRT2) ## Explore the synthetic data simCounts(simSRT2)[1:5,1:5]
After data generation, we can compare metrics of reference data and synthetic data
## Compute metrics simSRT1 <- compareSRT(simSRT1) ## Visualize Metrics visualize_metrics(simSRT1)
visualize_gene(simsrt=simSRT1,plotgn = "ENSG00000183036",rev_y=TRUE) visualize_gene(simsrt=simSRT2,plotgn = "ENSG00000168314",rev_y=TRUE)
This work was done by Jiaqiang Zhu, Lulu Shang and Xiang Zhou.
The r CRANpkg('SRTsim') package was made possible thanks to:
r Citep(bib[['R']])r Biocpkg('BiocStyle') r Citep(bib[['BiocStyle']])r CRANpkg('knitr') r Citep(bib[['knitr']])r CRANpkg('Matrix') r Citep(bib[['Matrix']])r CRANpkg("RefManageR") r Citep(bib[["RefManageR"]])r CRANpkg('rmarkdown') r Citep(bib[['rmarkdown']])r Biocpkg('S4Vectors') r Citep(bib[['S4Vectors']])r CRANpkg('sessioninfo') r Citep(bib[['sessioninfo']])Code for creating the vignette
## Create the vignette library("rmarkdown") system.time(render("SRTsim.Rmd")) ## Extract the R code library("knitr") knit("SRTsim.Rmd", tangle = TRUE)
Date the vignette was generated.
## Date the vignette was generated Sys.time()
Wallclock time spent generating the vignette.
## Processing time in seconds totalTime <- diff(c(startTime, Sys.time())) round(totalTime, digits = 3)
R session information.
## Session info library("sessioninfo") original <- options("width") options(width = 120) session_info() options(original)
This vignette was generated using r Biocpkg('BiocStyle') r Citep(bib[['BiocStyle']]), r CRANpkg('knitr') r Citep(bib[['knitr']]) and r CRANpkg('rmarkdown') r Citep(bib[['rmarkdown']]) running behind the scenes.
Citations made with r CRANpkg('RefManageR') r Citep(bib[['RefManageR']]).
## Print bibliography PrintBibliography(bib, .opts = list(hyperlink = "to.doc", style = "html"))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.