Import10X | R Documentation |
Wrapper for Read10X that imports data in the 10X format (mtx raw count matrix, cells in columns, with features.tsv(.gz) and barcodes.tsv(.gz) files) directly into a Seurat object. Additionally looks for metadata.tsv(.gz) in the same folder and imports it as metadata of the Seurat object. If some columns of the form PC_i, UMAP_i, TSNE_i, CC_i, or HARMONY_i are found in the metadata, they are directly imported as dimensionality reductions (pca, umap, tsne, cca, and harmony respectively) in the Seurat object. The function combines well with Export10X in particular, to easily save and re-import 10X data that has been filtered using Seurat objects, and is helpful as well to share exported data in simple language-agnostic formats.
Import10X(
dir,
project_name = "Project",
assay = "RNA",
gene.column = 1,
cell.column = 1,
unique.features = T,
strip.suffix = T
)
project_name |
character(1). A project name passed to CreateSeuratObject.Default: "" |
assay |
character(1). An assay name passed to CreateSeuratObject. Default: "RNA" |
gene.column |
integer(1). The column in the features.tsv that should be used as row names for the Seurat object. Passed to Read10X. Default: 1. |
cell.column |
integer(1). The column in the barcodes.tsv that should be used as column names for the Seurat object. Passed to Read10X. Default: 1. |
unique.features |
logical(1). Should the feature names be made unique. Passed to Read10X. Default: TRUE |
strip.suffix |
logical(1). Should a constant suffix such as "-1" be stripped from the barcodes. Passed to Read10X. Default: TRUE |
object |
Seurat object. |
A Seurat object.
# No project name, assay is RNA:
NewSeuratObject <- Import10X("MyDir")
# Re-export a Seurat object with two custom metadata columns, two dimensionality reductions, and without compression, then re-import it with a custom project and assay names:
Export10X(SeuratObject, "MyDir", c("nFeature_RNA", "mito.content"), c("pca","umap"), gzip=FALSE)
NewSeuratObject <- Import10X("MyDir","MyProject","mRNA3p")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.