Skip to contents

Imports the RNA (feature) modality of a 10x multiome HDF5 file into an existing ATAC dataset, aligned by cell barcode.

Usage

import_feature_matrix_10x(x, ...)

# S3 method for class 'MarchRProject'
import_feature_matrix_10x(
  x,
  input,
  dataset_name = character(0),
  matrix_name = "GeneExpressionMatrix",
  feature_type = "Gene Expression",
  genes_to_exclude = NULL,
  overwrite = FALSE,
  verbose = getOption("MarchR.verbose", FALSE),
  ...
)

Arguments

x

(MarchRProject) Project holding the target ATAC dataset.

...

Passed to methods.

input

(character) Path to a 10x feature-barcode HDF5 file.

dataset_name

(character) Target ATAC dataset to import into. Auto-selected if unambiguous.

matrix_name

(character) Output assay name. Default "GeneExpressionMatrix".

feature_type

(character) 10x feature type to keep. Default "Gene Expression".

genes_to_exclude

(character; optional) Features to drop after import, matched by ID or symbol.

overwrite

(logical) Overwrite an existing assay named matrix_name. Default FALSE.

verbose

(logical) Print progress messages. Default getOption("MarchR.verbose", FALSE).

Value

The MarchRProject with the RNA assay added to dataset_name, both modalities aligned to shared barcodes.

Details

Barcodes are intersected between the RNA matrix and the target dataset, and non-shared cells are dropped from both sides (counts are logged when verbose = TRUE). The RNA assay is added into the existing dataset rather than creating a new one.

Feature IDs (the 10x features/id field, typically Ensembl IDs) are used as the assay row names, and gene symbols (features/name) are stored in the assay's feature metadata under gene_symbol. Accordingly, genes_to_exclude drops a feature when it matches either the ID or the symbol. When symbols cannot be read from the file, the function warns, matches genes_to_exclude by ID only, and adds no gene_symbol metadata.

ArchR correspondence

Analogous to ArchR's import10xFeatureMatrix(), scoped to a single file.