calc_cor: Compute all pairwise trait correlations

View source: R/calc_cor.R

calc_corR Documentation

Compute all pairwise trait correlations

Description

Computes pairwise correlations for all traits using either cor (faster) or cor (slower).

Usage

calc_cor(
  obj,
  keys = NULL,
  graph_key = NULL,
  assay = NULL,
  slot = NULL,
  transpose = FALSE,
  method = "pearson",
  fill_na = NULL,
  use = "all.obs",
  nThreads = 1,
  verbose = TRUE
)

Arguments

obj

Object of class:

  • DimReduc

  • Seurat

  • AnnData

  • prcomp

  • CellDataSet

  • list

  • matrix/data.frame

keys

The keys of reductions to extract from.

method

a character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman": can be abbreviated.

use

an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs".

nThreads

non-negative integer specifying the number of parallel threads to be used by certain parts of correlation calculations. This option only has an effect on systems on which a POSIX thread library is available (which currently includes Linux and Mac OSX, but excludes Windows). If zero, the number of online processors will be used if it can be determined dynamically, otherwise correlation calculations will use 2 threads. Note that this option does not affect what is usually the most expensive part of the calculation, namely the matrix multiplication. The matrix multiplication is carried out by BLAS routines provided by R; these can be sped up by installing a fast BLAS and making R use it.

verbose

Print messages.

Value

A single-cell object with a graph.


bschilder/scKirby documentation built on Oct. 2, 2024, 10:16 p.m.