Generate simulated spatial transcriptomics data or scRNAseq data.

gendata_RNAExp(height=30, width=30, platform="ST", p =100, q=10, K=7, 
                            G=4,sigma2=1, tau=8, seed=1, view=FALSE)

Arguments

height, width

Height and width of lattice grids for generating spatial coordinates. n=height * width cells for scRNAseq data

platform

set the platform for the simulated data, only support 'ST' and 'scRNAseq'.

p

number of genes to generate.

q

number of true latent features to generate gene expression

K

number of clusters (cell types).

seed

random seed for generate data

G

the number of neighbors. The latter must be one of G = 4 or G = 8, which respectively correspond to a first order and a second order dependency structure. By default, G = 4.

sigma2

Variance of error term in probabilitic PCA model.

tau

a positive factor of mixture mean values.

view

Logical value indicating whether the draw should be printed. Do not display the optional borders.

Details

Nothing

Value

return a "Seurat" object. If platform="ST", then the metadata of this Seurat object will include two columns with names "row" and "col" which are the spatial coordinates; If platform="scRNAseq", then the metadata of this Seurat object will not have them.

References

None

Author

Wei Liu

Note

nothing

See also

None

Examples


## we generate the spatial transcriptomics data with lattice neighborhood, i.e. ST platform.
seu <- gendata_RNAExp(height=20, width=20,p=200, K=4)
seu
#> An object of class Seurat 
#> 200 features across 400 samples within 1 assay 
#> Active assay: RNA (200 features, 0 variable features)

## generate scRNAseq data
seu <- gendata_RNAExp(height=20, width=20, platform="scRNAseq", p=100, K=4)
seu
#> An object of class Seurat 
#> 100 features across 400 samples within 1 assay 
#> Active assay: RNA (100 features, 0 variable features)