Skip to contents

Reads an ATAC object from an h5ad file. Peak data is taken from the 'X' section and metadata is taken from 'obs'. The 'var' section can contain a special field called 'ignore' which marks peaks that should be ignored.

Usage

import_from_h5ad(
  file,
  class = NULL,
  genome = NULL,
  id = NULL,
  description = NULL,
  tad_based = NULL
)

Arguments

file

name of an h5ad file with ATAC data

class

is the file storing ScPeaks or McPeaks. If NULL - the class would be determined by the 'class' field in the 'uns' part of the h5ad file, if exists and otherwise the class would be McPeaks.

genome

genome assembly of the peaks. e.g. "hg38", "hg19", "mm9", "mm10". If NULL - the assembly would be determined by the 'genome' field in the 'uns' part of the h5ad file.

id

an identifier for the object, e.g. "pbmc". If NULL - the id would be determined by the 'id' field in the 'uns' part of the h5ad file, and if this doesn't exist - a random id would be assigned.

description

description of the object, e.g. "PBMC from a healthy donor - granulocytes removed through cell sorting (10k)". If NULL - the id would be determined by the 'description' field in the 'uns' part of the h5ad file

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. if NULL - the value would be determined by the 'tad_based' field in the 'uns' part of the h5ad file, and if this doesn't exist - the value would be TRUE.

Value

an ScPeaks/McPeaks object

Examples

if (FALSE) {
atac_sc <- import_from_10x("pbmc_data", genome = "hg38")
export_to_h5ad(atac_sc, "pbmc_data/atac_sc.h5ad")
atac_sc_loaded <- import_from_h5ad("pbmc_data/atac_sc.h5ad")
}