Convert Seurat objects to 10x Genomics Loupe files.
How To Use • Installation • Troubleshooting
loupeR
creates a 10x Genomics Loupe file from a Seurat object. 10x Genomics Loupe Browser can visualize single-cell and spatial data from 10x Genomics. Only single-cell gene expression datasets are supported.
Converting a Seurat object to a Loupe file is as simple as the following:
# import the library
library("loupeR")
# convert the SeuratObject named `seurat_obj` to a Loupe file
create_loupe_from_seurat(seurat_obj)
Use the function create_loupe
if you need more control in the clusters and projetions that included in the Loupe file.
# import the library
library("loupeR")
# Gene Expression RNA assay
assay <- seurat_obj[["RNA"]]
# convert the count matrix, clusters, and projections into a Loupe file
create_loupe(
assay@counts,
clusters = select_clusters(seurat_obj),
projections = select_projections(seurat_obj)
)
Before using loupeR
, make sure that your system has installed HDF5. The HDF5 organization requires registration before being able to download the installer. Below are some other more convenient methods for installing HDF5 if you happen to have these package managers installed.
In RStudio, or your R shell, run the following to install this package.
# install dependencies
if (!require("hdf5r")) install.packages("hdf5r")
if (!require("Seurat")) install.packages("Seurat")
# install platform specific source package
os <- sub("Darwin", "macOS", Sys.info()["sysname"])
url <- paste0("https://github.com/10XGenomics/loupeR/releases/latest/download/loupeR_", os, ".tar.gz")
install.packages(url, repos = NULL, type = "source")
Another installation option is to use the remotes
package to directly install loupeR
and its dependencies. The installed package won't include the prebundled louper executable, so you must invoke the loupeR::setup()
function which will go and download it.
remotes::install_github("10XGenomics/loupeR")
loupeR::setup()
For more in depth documentation and support please head to our support page or send an email to [email protected]
Additionally, we have provided utility functions to help gather useful information when contacting support or creating a Github issue.
# import the library
library("loupeR")
# print extra debug information
create_bugreport_from_seurat(seurat_obj)