Title: | R Package for Analyzing Tomo-seq Data |
---|---|
Description: | `tomoseqr` is an R package for analyzing Tomo-seq data. Tomo-seq is a genome-wide RNA tomography method that combines combining high-throughput RNA sequencing with cryosectioning for spatially resolved transcriptomics. `tomoseqr` reconstructs 3D expression patterns from tomo-seq data and visualizes the reconstructed 3D expression patterns. |
Authors: | Ryosuke Matsuzawa [aut, cre] |
Maintainer: | Ryosuke Matsuzawa <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.11.0 |
Built: | 2024-12-18 04:25:26 UTC |
Source: | https://github.com/bioc/tomoseqr |
Animate 2D expressions along one axis and generate GIF file.
animate2d( tomoObj, geneID, along = "x", main = geneID, xlab = "x", ylab = "y", file = str_c(geneID, "_", along, ".gif"), zlim = NA, interval = 0.1, aspectX = 1, aspectY = 1 )
animate2d( tomoObj, geneID, along = "x", main = geneID, xlab = "x", ylab = "y", file = str_c(geneID, "_", along, ".gif"), zlim = NA, interval = 0.1, aspectX = 1, aspectY = 1 )
tomoObj |
tomoSeq object |
geneID |
single gene ID (string) |
along |
Parameter specifying along which axis the cross section should be plotted. |
main |
A string used for the title of the plot. Default is |
xlab |
Label of x axis. Default is |
ylab |
Label of y axis. Default is |
file |
Path of GIF file. |
zlim |
Limit of value of heatmap. If target="mask", it is ignored. |
interval |
interval of GIF animation. |
aspectX |
Width of figure. If you don't specify the value of this parameter, It is calculated based on the number of sections Corresponding to the horizontal axis |
aspectY |
Height of figure. If you don't specify the value of this parameter, It is calculated based on the number of sections Corresponding to the vertical axis |
It generate GIF file.
if(interactive()) { data(tomoObj) animate2d(tomoObj, "gene2", target = "expression", file = "example.gif") }
if(interactive()) { data(tomoObj) animate2d(tomoObj, "gene2", target = "expression", file = "example.gif") }
Load data of Junker2014 from cache.
doadJunker2014(tomoseqrCache)
doadJunker2014(tomoseqrCache)
tomoseqrCache |
Cache of tomoseqr. You can get it using
|
List of tomo-seq data in cache.
Download part of the Tomo-seq data published by Junker et al.
downloadJunker2014(verbose = FALSE)
downloadJunker2014(verbose = FALSE)
verbose |
If you want to force downloads with or without cache, set this to TRUE. |
BiocFileCache object.
Estimate 3d expressions
estimate3dExpressions(x, y, z, mask, query, numIter = 100, normalize = TRUE)
estimate3dExpressions(x, y, z, mask, query, numIter = 100, normalize = TRUE)
x |
A data.frame object containing a simulated Tomo-seq data for x-axis sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections. |
y |
A data.frame object containing a simulated Tomo-seq data for y-axis sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections. |
z |
A data.frame object containing a simulated Tomo-seq data for z-axis sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections. |
mask |
A 3D array that represents if each boxel is included to sample.
You can make a mask using |
query |
Vector of gene IDs |
numIter |
How many times iterate |
normalize |
Whether to normalize so that total expression per sample volume is equal between sections. |
tomoSeq object
data("testx", "testy", "testz", "mask") estimate3dExpressions( testx, testy, testz, mask = mask, query = c("gene1"), normalize = TRUE )
data("testx", "testy", "testz", "mask") estimate3dExpressions( testx, testy, testz, mask = mask, query = c("gene1"), normalize = TRUE )
Extract geneIDs to which hoge can be applied.
extractGeneList(x, y, z)
extractGeneList(x, y, z)
x |
A data.frame object containing a Tomo-seq data for x-axis sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections. |
y |
A data.frame object containing a Tomo-seq data for y-axis sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections. |
z |
A data.frame object containing a Tomo-seq data for z-axis sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections. |
A vector that contains genes which can be used for
estimate3dExpressions
.
data("testx", "testy", "testz") extractGeneList(testx, testy, testz)
data("testx", "testy", "testz") extractGeneList(testx, testy, testz)
Find peak genes on axial
findAxialGenes(tomoSeqData, genes = "all")
findAxialGenes(tomoSeqData, genes = "all")
tomoSeqData |
tomo-seq data of any axis |
genes |
If run for all genes |
A data frame consisting of gene ID, max of expression levels of the gene, mean of expression levels calculated by excluding the maximum value and section number showing the maximum expression level (0 means that there is no such section).
data(testx) findAxialGenes(testx)
data(testx) findAxialGenes(testx)
Get reconstructed matrix
getReconstructedResult(tomoObj, geneID)
getReconstructedResult(tomoObj, geneID)
tomoObj |
tomoSeq object |
geneID |
single gene ID |
Reconstruction result as matrix
data(tomoObj) getReconstructedResult(tomoObj, "gene2")
data(tomoObj) getReconstructedResult(tomoObj, "gene2")
Output the reconstructed expression pattern as an image.
imageViewer(tomoObj)
imageViewer(tomoObj)
tomoObj |
tomoSeq object |
NA
if (interactive()) { data(tomoObj) imageViewer(tomoObj, "gene2") }
if (interactive()) { data(tomoObj) imageViewer(tomoObj, "gene2") }
It is a matrix representing the mask. Each element of the matrix corresponds to a voxel, and has the value 1 if the voxel is included in the mask, 0 if it is not.
Make mask
masker()
masker()
NA
if (interactive()) { masker() }
if (interactive()) { masker() }
Plot expressions of all genes along an axis
plot1dAllExpression(tomoSeqData, ...)
plot1dAllExpression(tomoSeqData, ...)
tomoSeqData |
A data.frame object containing a Tomo-seq data for any sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections. |
... |
Arguments which are related to plot parameters.
Prease refer to |
NA
data("testx") plot1dAllExpression(testx)
data("testx") plot1dAllExpression(testx)
Plot expression of single gene along an axis
plot1dExpression(tomoObj, geneID, axes)
plot1dExpression(tomoObj, geneID, axes)
tomoObj |
tomoSeq object |
geneID |
single gene ID (string) |
axes |
axis ("x", "y" or "z") |
NA
data(tomoObj) plot1dExpression(tomoObj, "gene2", "x")
data(tomoObj) plot1dExpression(tomoObj, "gene2", "x")
Plot the trend of the value of the loss function.
plotLossFunction(tomoObj, geneID)
plotLossFunction(tomoObj, geneID)
tomoObj |
tomoSeq object |
geneID |
single gene ID (string) |
NA
data(tomoObj) plotLossFunction(tomoObj, "gene2")
data(tomoObj) plotLossFunction(tomoObj, "gene2")
A data.frame object containing a simulated Tomo-seq data for x-axis sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections.
A data.frame object containing a simulated Tomo-seq data for y-axis sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections.
A data.frame object containing a simulated Tomo-seq data for z-axis sections. The rows represent genes. The first column contains gene IDs and the second and subsequent columns contain gene expression levels in sections.
Convert reconstructed matrix to data.frame.
toDataFrame(tomoObj, geneID)
toDataFrame(tomoObj, geneID)
tomoObj |
tomoSeq object |
geneID |
single gene ID |
Reconstruction result converted to dataframe.
data(tomoObj) toDataFrame(tomoObj, "gene2")
data(tomoObj) toDataFrame(tomoObj, "gene2")