Package 'tomoseqr'

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

Help Index


Animate 2D expressions along one axis and generate GIF file.

Description

Animate 2D expressions along one axis and generate GIF file.

Usage

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
)

Arguments

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 geneID.

xlab

Label of x axis. Default is xaxis.

ylab

Label of y axis. Default is yaxis.

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

Value

It generate GIF file.

Examples

if(interactive()) {
    data(tomoObj)
    animate2d(tomoObj, "gene2", target = "expression", file = "example.gif")
}

Load data of Junker2014 from cache.

Description

Load data of Junker2014 from cache.

Usage

doadJunker2014(tomoseqrCache)

Arguments

tomoseqrCache

Cache of tomoseqr. You can get it using downloadJunker2014.

Value

List of tomo-seq data in cache.


Download part of the Tomo-seq data published by Junker et al.

Description

Download part of the Tomo-seq data published by Junker et al.

Usage

downloadJunker2014(verbose = FALSE)

Arguments

verbose

If you want to force downloads with or without cache, set this to TRUE.

Value

BiocFileCache object.


Estimate 3d expressions

Description

Estimate 3d expressions

Usage

estimate3dExpressions(x, y, z, mask, query, numIter = 100, normalize = TRUE)

Arguments

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 masker.

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.

Value

tomoSeq object

Examples

data("testx", "testy", "testz", "mask")
estimate3dExpressions(
    testx,
    testy,
    testz,
    mask = mask,
    query = c("gene1"), 
    normalize = TRUE
)

Extract geneIDs to which hoge can be applied.

Description

Extract geneIDs to which hoge can be applied.

Usage

extractGeneList(x, y, z)

Arguments

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.

Value

A vector that contains genes which can be used for estimate3dExpressions.

Examples

data("testx", "testy", "testz")
extractGeneList(testx, testy, testz)

Find peak genes on axial

Description

Find peak genes on axial

Usage

findAxialGenes(tomoSeqData, genes = "all")

Arguments

tomoSeqData

tomo-seq data of any axis

genes

If run for all genes

Value

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

Examples

data(testx)
findAxialGenes(testx)

Get reconstructed matrix

Description

Get reconstructed matrix

Usage

getReconstructedResult(tomoObj, geneID)

Arguments

tomoObj

tomoSeq object

geneID

single gene ID

Value

Reconstruction result as matrix

Examples

data(tomoObj)
getReconstructedResult(tomoObj, "gene2")

Output the reconstructed expression pattern as an image.

Description

Output the reconstructed expression pattern as an image.

Usage

imageViewer(tomoObj)

Arguments

tomoObj

tomoSeq object

Value

NA

Examples

if (interactive()) {
    data(tomoObj)
    imageViewer(tomoObj, "gene2")
}

A matrix containing mask data.

Description

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

Description

Make mask

Usage

masker()

Value

NA

Examples

if (interactive()) {
    masker()
}

Plot expressions of all genes along an axis

Description

Plot expressions of all genes along an axis

Usage

plot1dAllExpression(tomoSeqData, ...)

Arguments

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 plot.

Value

NA

Examples

data("testx")
plot1dAllExpression(testx)

Plot expression of single gene along an axis

Description

Plot expression of single gene along an axis

Usage

plot1dExpression(tomoObj, geneID, axes)

Arguments

tomoObj

tomoSeq object

geneID

single gene ID (string)

axes

axis ("x", "y" or "z")

Value

NA

Examples

data(tomoObj)
plot1dExpression(tomoObj, "gene2", "x")

Plot the trend of the value of the loss function.

Description

Plot the trend of the value of the loss function.

Usage

plotLossFunction(tomoObj, geneID)

Arguments

tomoObj

tomoSeq object

geneID

single gene ID (string)

Value

NA

Examples

data(tomoObj)
plotLossFunction(tomoObj, "gene2")

A data.frame object containing a simulated Tomo-seq data for x-axis sections.

Description

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.

Description

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.

Description

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.

Description

Convert reconstructed matrix to data.frame.

Usage

toDataFrame(tomoObj, geneID)

Arguments

tomoObj

tomoSeq object

geneID

single gene ID

Value

Reconstruction result converted to dataframe.

Examples

data(tomoObj)
toDataFrame(tomoObj, "gene2")

A tomoSeq object.

Description

It is a tomoSeq object generated from testx, testy, testz and mask.