remove_redundancy-methods: Drop redundant elements (e.g., elements) for which feature...

remove_redundancyR Documentation

Drop redundant elements (e.g., elements) for which feature (e.g., feature/gene) aboundances are correlated

Description

remove_redundancy() takes as input a 'tbl' formatted as | <element> | <feature> | <value> | <...> | for correlation method, and returns a 'tbl' with dropped elements (e.g., elements). The backend function used is widyr::pairwise_cor (David Robinson, 2020)

Usage

remove_redundancy(
  .data,
  .element,
  .feature,
  .value,
  of_elements = TRUE,
  correlation_threshold = 0.9,
  top = Inf,
  transform = NULL
)

## S3 method for class 'spec_tbl_df'
remove_redundancy(
  .data,
  .element,
  .feature,
  .value,
  of_elements = TRUE,
  correlation_threshold = 0.9,
  top = Inf,
  transform = NULL
)

## S3 method for class 'tbl_df'
remove_redundancy(
  .data,
  .element,
  .feature,
  .value,
  of_elements = TRUE,
  correlation_threshold = 0.9,
  top = Inf,
  transform = NULL
)

Arguments

.data

A 'tbl' formatted as | <element> | <feature> | <value> | <...> |

.element

The name of the element column (normally elements).

.feature

The name of the feature column (normally features)

.value

The name of the column including the numerical value the clustering is based on (normally feature value)

of_elements

A boolean. In case the input is a nanny object, it indicates Whether the element column will be element or feature column

correlation_threshold

A real number between 0 and 1. For correlation based calculation.

top

An integer. How many top genes to select for correlation based method

transform

A function to use to tranforma the data internalli (e.g., log1p)

Details

\lifecycle

maturing

This function removes redundant elements from the original data set (e.g., elements or features). For example, if we want to define cell-type specific signatures with low element redundancy. This function returns a tibble with dropped recundant elements (e.g., elements). Two redundancy estimation approaches are supported: (i) removal of highly correlated clusters of elements (keeping a representative) with method="correlation"; (ii) removal of most proximal element pairs in a reduced dimensional space.

Value

A tbl object with with dropped recundant elements (e.g., elements).

A tbl object with with dropped recundant elements (e.g., elements).

A tbl object with with dropped recundant elements (e.g., elements).

Examples




remove_redundancy(mtcars_tidy, car_model, feature, value)



stemangiola/nanny documentation built on July 29, 2023, 1:23 a.m.