wrapper_Signac_FeatureMatrix: Wrapper around 'FeatureMatrix' function from Signac Package

View source: R/preprocessing_filtering_reduction.R

wrapper_Signac_FeatureMatrixR Documentation

Wrapper around 'FeatureMatrix' function from Signac Package

Description

Wrapper around 'FeatureMatrix' function from Signac Package

Usage

wrapper_Signac_FeatureMatrix(
  files_dir_list,
  which,
  ref = "hg38",
  process_n = 2000,
  set_future_plan = TRUE,
  verbose = TRUE,
  progress = NULL
)

Arguments

files_dir_list

A named character vector of directories containing the files. The names correspond to sample names.

which

A GenomicRanges containing the features to count on.

ref

Reference genome to use (hg38).Chromosomes that are not present in the canonical chromosomes of the given reference genome will be excluded from the matrix.

process_n

Number of regions to load into memory at a time, per thread. Processing more regions at once can be faster but uses more memory. (2000)

set_future_plan

Set 'multisession' plan within the function (TRUE). If TRUE, the previous plan (e.g. future::plan()) will be set back on exit.

verbose

Verbose (TRUE).

progress

Progress object for Shiny.

Details

Signac & future are not required packages for ChromSCape as they are required only for the fragment matrix calculations. To use this function, install Signac package first (future will be installed as a dependency). For the simplicity of the application & optimization, the function by defaults sets future::plan("multisession") with workers = future::availableCores(omit = 1) in order to allow parallel processing with Signac. On exit the plan is re-set to the previously set future plan. Note that future multisession may have trouble running when VPN is on. To run in parallel, first deactivate your VPN if you encounter long runtimes.

Value

A sparse matrix of features x cells

References

Stuart el al., Multimodal single-cell chromatin analysis with Signac bioRxiv https://doi.org/10.1101/2020.11.09.373613

Examples

## Not run: 
gr_bins = define_feature("hg38", bin_width = 50000)
wrapper_Signac_FeatureMatrix("/path/to/dir_containing_fragment_files",
 gr_bins, ref = "hg38")

## End(Not run)

vallotlab/ChromSCape documentation built on Oct. 15, 2023, 1:47 p.m.