tuneFilterWeights: Tune filter weights

View source: R/DataParsingFunctions.R

tuneFilterWeightsR Documentation

Tune filter weights

Description

tuneFilterWeights generates cell homogeneity scores for filter weight settings (by default 0 and 1 for on and off) across all filters. Each filter can either apply just to specific peaks or to whole genes (filterGene, TRUE by default) and can be permissive or filtering out (filterOut, FALSE by default). Regions mapping peaks to genes must be provided to use filters. If filters are applied to specific peaks, peaks for the ATAC data must also be provided. To speed up calculations cells can be subsampled to a specified sampleDepth (default 5000).

Usage

tuneFilterWeights(
  cellEdges,
  labelGenesList,
  labelEdgesList,
  labelEdgeWeights,
  ATACMat,
  ATACGenePeak,
  method = "Expression",
  filters,
  filterWeightOpts = c(0, 1),
  filterOut,
  filterGene,
  regions,
  peaks,
  sampleDepth = 5000,
  steps,
  cellTypes,
  parallel = FALSE,
  numCores = 1,
  trackProgress = FALSE,
  tensorflow = FALSE
)

Arguments

cellEdges

matrix of cell-to-cell similarity (c-by-c)

labelGenesList

list of tables with genes of interest in first column and corresponding labels in second column, optionally log-fold change in expression values in the third

labelEdgesList

list of cell-to-label similarity matrices each with dimensions c-by-l

labelEdgeWeights

vector of edge weights corresponding to list of cell-to-label similarity matrices

ATACMat

either a cell-by-peak matrix or a SnapATAC object

ATACGenePeak

per label mapping of peaks to genes returned by mapPeaksToGenes()

method

scaling method, either "Expression","Correlation", or "None"

filters

list of GRanges for locations that pass filters

filterWeightOpts

vector of parameters to test for weights assigned to each filter

filterOut

boolean for each filter of whether those regions are permitted or filtered out

filterGene

boolean for each filter of whether it applies to genes as a whole or just overlapping peaks (note that weights do not apply to peaks)

regions

regions map peaks to genes

peaks

GRanges of peaks in ATACMat

sampleDepth

integer, depth to subsample cells to for faster calculation

steps

integer indicating number of steps to take if walk should not be run to convergence

cellTypes

list of names of cell types, if not provided unique cell labels are used

parallel

boolean, execute in parallel

numCores

integer, number of cores to use for parallel execution

trackProgress

boolean, print percent run completed

tensorflow

boolean to indicate whether to compute on GPU

Value

data frame of parameters with corresponding cell homogeneity

Examples

data("SampleCellWalkRData")
regions <- getRegions()
filters <- list(SampleCellWalkRData$filter)
labelGenesList <- list(SampleCellWalkRData$labelGenes)
labelEdgesList <- list(SampleCellWalkRData$labelEdges)
## Not run: tuneFilterWeights(SampleCellWalkRData$cellEdges,
                  labelGenesList,
                  labelEdgesList,
                  1,
                  SampleCellWalkRData$ATACMat,
                  SampleCellWalkRData$ATACGenePeak,
                  filters=filters,
                  regions=regions)
## End(Not run)


PFPrzytycki/CellWalkR documentation built on Oct. 26, 2023, 1:50 p.m.