getBmatFromSnap: Get Bmat from Snap object.

getBmatFromSnapR Documentation

Get Bmat from Snap object.

Description

Note: this function is validated with SnapATAC::addBmatFromSnap To include all the chromes in snap file, chrs <- unique(unlist(lapply(strsplit(snap@feature$name, ":"), function(x)x1))) where snap is a snap object created by SnapATAC.

Usage

getBmatFromSnap(
  snapFile,
  binSize = 5000,
  chrs = c(paste0("chr", 1:19), "chrX", "chrY"),
  ibarcode = NULL,
  blacklistBedFile = NULL,
  outfile = NULL,
  compressLevel = 9
)

Arguments

chrs

vector of string, the chroms we want. Since there might exist chroms like chrM, chrY_JH584303_random, chrUn_GL456390, so here we use explicitly chrs we want to filter chroms. The default is specific for mm10.

ibarcode

vector of string, the barcodes we want to, we assume all of them are in this snapFile. So use this carefully.

blacklistBedFile

string, bed file of the blacklist, smmtools save one under data dir for mm10.

Value

sparseMatrix, cell by feature, with both row and colname and ordered by ibarcode if provided


beyondpie/smmtools documentation built on July 1, 2022, 4:33 a.m.