correlate_windows: Calculate correlations against top window.

Description Usage Arguments Details Value Examples

View source: R/correlate_windows.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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

scFeatureFilter documentation built on Nov. 8, 2020, 7:49 p.m.