Title: | Converts Seurat objects to 10x Genomics Loupe files |
---|---|
Description: | Converts Seurat objects to 10x Genomics Loupe files. This is a second line to make the package checker not complain. |
Authors: | Eric Siegel [aut, cre] |
Maintainer: | Eric Siegel <[email protected]> |
License: | file LICENSE |
Version: | 1.1.2 |
Built: | 2024-10-29 12:26:33 UTC |
Source: | https://github.com/10XGenomics/loupeR |
Extract the counts matrix from the Assay
counts_matrix_from_assay(assay)
counts_matrix_from_assay(assay)
assay |
A SeuratObject::Assay or SeuratObject::Assay5 |
A sparse counts matrix
This bugreport can then be included when reaching out to 10xGenomics Support or when filing a Github ticket. This information should be included along with any other output when creating a Loupe file.
create_bugreport( count_mat, clusters, projections, assay_name = NULL, seurat_obj_version = NULL, skip_metadata = FALSE )
create_bugreport( count_mat, clusters, projections, assay_name = NULL, seurat_obj_version = NULL, skip_metadata = FALSE )
count_mat |
A sparse dgCMatrix as is generated via Matrix::rsparsematrix. Rows are features, Columns are barcodes. |
clusters |
list of factors that hold information for each barcode |
projections |
list of matrices, all with dimensions (barcodeCount x 2) |
assay_name |
optional string that holds the Seurat Object assay name. |
seurat_obj_version |
optional string that holds the Seurat Object version. It is useful for debugging compatibility issues. |
skip_metadata |
optional logical which skips printing metadata |
This bugreport can then be included when reaching out to 10xGenomics Support or when filing a Github ticket. This information should be included along with any other output when creating a Loupe file.
create_bugreport_from_seurat(obj)
create_bugreport_from_seurat(obj)
obj |
A Seurat Object |
Create a Loupe file
create_loupe( count_mat, clusters = list(), projections = list(), output_dir = NULL, output_name = NULL, feature_ids = NULL, executable_path = NULL, force = FALSE, seurat_obj_version = NULL )
create_loupe( count_mat, clusters = list(), projections = list(), output_dir = NULL, output_name = NULL, feature_ids = NULL, executable_path = NULL, force = FALSE, seurat_obj_version = NULL )
count_mat |
A sparse dgCMatrix as is generated via Matrix::rsparsematrix. Rows are features, Columns are barcodes. |
clusters |
list of factors that hold information for each barcode |
projections |
list of matrices, all with dimensions (barcodeCount x 2) |
output_dir |
optional directory where the Loupe file will be written |
output_name |
optional name of the Loupe file with the extensions not included. |
feature_ids |
optional character vector that specifies the feature ids of the count matrix. Typically, these are the ensemble ids. |
executable_path |
optional path to the louper executable. |
force |
optional logical as to whether we should overwrite an already existing file |
seurat_obj_version |
optional string that holds the Seurat Object version. It is useful for debugging compatibility issues. |
TRUE on success, FALSE on error
create_loupe_from_seurat()
passes the active counts matrix,
reductions, and factors found in meta.data
to create a Loupe file.
create_loupe_from_seurat( obj, output_dir = NULL, output_name = NULL, dedup_clusters = FALSE, feature_ids = NULL, executable_path = NULL, force = FALSE )
create_loupe_from_seurat( obj, output_dir = NULL, output_name = NULL, dedup_clusters = FALSE, feature_ids = NULL, executable_path = NULL, force = FALSE )
obj |
A Seurat Object |
output_dir |
optional directory where the Loupe file will be written |
output_name |
optional name of the Loupe file with the extensions not included. |
dedup_clusters |
optional logical that will try to deduplicate all clusters that are numerically the same |
feature_ids |
optional character vector that specifies the feature ids of the count matrix. Typically, these are the ensemble ids. |
executable_path |
optional path to the louper executable. |
force |
optional logical as to whether we should overwrite an already existing file |
TRUE on success, FALSE on error
Read FeatureIds from 10x features.tsv.gz file
read_feature_ids_from_tsv(tsv_path)
read_feature_ids_from_tsv(tsv_path)
tsv_path |
character vector path to the features.tsv.gz file |
A character vector of the feature ids
Prioritizes the active assay, then RNA, and then the rest Usable assays must have a non empty count matrix
select_assay(obj)
select_assay(obj)
obj |
A Seurat Object |
A list with the named Seurat Assay or NULL if not found
Select clusters from the assay
select_clusters(obj, dedup = FALSE)
select_clusters(obj, dedup = FALSE)
obj |
A Seurat Object |
dedup |
logical to dedupicate clusters. Default TRUE. |
A list of factors
Select projections from the assay
select_projections(obj)
select_projections(obj)
obj |
A Seurat Object |
A list of matrices, all with dimensions (barcodeCount x 2)
Setup eula and download executable
setup(executable_path = NULL)
setup(executable_path = NULL)
executable_path |
optional string to a non default executable path |
Validate the format of the barcodes
validate_barcodes(barcodes)
validate_barcodes(barcodes)
barcodes |
a character vector |
A list with two elements:
success: a logical value indicating success (TRUE) or failure (FALSE)
msg: an optional error message (NULL if success is TRUE)
Validate the seurat clusters
validate_clusters(clusters, barcode_count)
validate_clusters(clusters, barcode_count)
clusters |
list of factors that hold information for each barcode |
barcode_count |
number of barcodes |
A list with two elements:
success: a logical value indicating success (TRUE) or failure (FALSE)
msg: an optional error message (NULL if success is TRUE)
Validate the seurat count matrix
validate_count_mat(count_mat, feature_ids = NULL)
validate_count_mat(count_mat, feature_ids = NULL)
count_mat |
A sparse dgCMatrix as is generated via Matrix::rsparsematrix. Rows are features, Columns are barcodes. |
feature_ids |
optional character vector that specifies the feature ids of the count matrix. Typically, these are the ensemble ids. |
A list with two elements:
success: a logical value indicating success (TRUE) or failure (FALSE)
msg: an optional error message (NULL if success is TRUE)
Validate the seurat projections
validate_projections(projections, barcode_count)
validate_projections(projections, barcode_count)
projections |
list of matrices, all with dimensions (barcodeCount x 2) |
barcode_count |
number of barcodes |
A list with two elements:
success: a logical value indicating success (TRUE) or failure (FALSE)
msg: an optional error message (NULL if success is TRUE)