Skip to contents

Create an ScPeaks object from 10x directory

Usage

import_from_10x(
  dir,
  genome,
  id = NULL,
  description = NULL,
  metadata = NULL,
  matrix_fn = file.path(dir, "matrix.mtx"),
  cells_fn = file.path(dir, "barcodes.tsv"),
  features_fn = file.path(dir, "features.tsv"),
  tad_based = TRUE,
  zero_based = FALSE
)

Arguments

dir

10x directory. Should have the following files: 'matrix.mtx', 'barcodes.tsv' and 'features.tsv'. If you used 'Cell Ranger ARC', this should be the 'outs/filtered_feature_bc_matrix' directory.
For more details see: https://support.10xgenomics.com/single-cell-multiome-atac-gex/software/overview/welcome

genome

genome assembly of the peaks. e.g. "hg38", "hg19", "mm9", "mm10"

id

an identifier for the object, e.g. "pbmc". If NULL - a random id would be assigned.

description

(Optional) description of the object, e.g. "PBMC from a healthy donor - granulocytes removed through cell sorting (10k)".

metadata

(Optional) data frame with a column called 'metacell' and additional metacell annotations, or the name of a delimited file which contains such annotations.

matrix_fn

if dir is missing, the filename of the matrix to import ("matrix.mtx" or "matrix.mtx.gz")

cells_fn

if dir is missing, the filename of the cells to import ("barcodes.tsv" or "barcodes.tsv.gz")

features_fn

if dir is missing, the filename of the features to import ("features.tsv" or "features.tsv.gz")

tad_based

whether to name peaks based on TADs if possible (when an intervals set named "intervs.global.tad_names" exists). When FALSE - peaks are named based on their coordinates.

zero_based

are the coordinates of the features 0-based? Note that when this is FALSE (default) the coordinates of the created object would be different from the ones in features_fn by 1 bp.

Value

an ScPeaks object

Examples

if (FALSE) {
atac <- import_from_10x("./pbmc_data", genome = "hg38")
atac
}