correlate_windows {scFeatureFilter}R Documentation

Calculate correlations against top window.

Description

Calculates pairwise correlations between all features each window against all features in the reference window.

Usage

correlate_windows(dataset, n_random = 3, ...)

Arguments

dataset

A data frame containing all the binned genes. Usually the output of bin_scdata.

n_random

Number of top window randomization to serve as a negative control. Default to 3.

...

Additional arguments to be passed to cor. Default method is pearson which is the fastest.

Details

This function:

The input of this function is usually the output of the bin_scdata function.

Value

A tibble containing correlation values.

Examples

library(magrittr)
expMat <- matrix(
    c(1, 1, 5,
      1, 2, 3,
      0, 1, 4,
      0, 0, 2),
    ncol = 3, byrow = TRUE, dimnames = list(paste("gene", 1:4), paste("cell", 1:3))
)

calculate_cvs(expMat) %>%
    define_top_genes(window_size = 2) %>%
    bin_scdata(window_number = 1) %>%
    correlate_windows


[Package scFeatureFilter version 1.14.0 Index]