quantiling: Quantiling

View source: R/data_conditionals.R

quantilingR Documentation

Quantiling

Description

This is a companion function to 'conditionals' that allows the specification of a variable by which to split the data into quantiles before plotting.

Usage

quantiling(
  by = NULL,
  n = NULL,
  samples = NULL,
  descending = TRUE,
  aggr_fun = mean
)

Arguments

by

Continuous metric for calculating quantiles.

n

Number of quantiles to calculate.

samples

Samples to use when setting quantiles.

descending

Order quantiles in descending order.

aggr_fun

Function by which to aggregate scores if more than one sample selected.

Details

Column to order by should be specified by names/symbol and not character. By default ,quantiling is calculated based on the aggregate value (based on 'aggr_fun') of the variable across all samples. If 'samples' is specified, only the given samples will be used for aggregate calculation and ordering. 'descending' controls whether quantiling is calculated in descending (TRUE) or ascending (FALSE) order, and 'n' allows specification of number of quantiles.

Value

A list of quantiling parameters to be passed to the 'data_quantiling' argument of 'conditionals'.

See Also

conditionals For more information on advanced data conditions.

Examples


data(TSSs)
assembly <- system.file("extdata", "S288C_Assembly.fasta", package="TSRexploreR")

exp <- TSSs[1] %>%
  tsr_explorer(genome_assembly=assembly) %>%
  format_counts(data_type="tss")

# Sequence base color plot quantiled by score.
conditions <- conditionals(data_quantiling=quantiling(score, n=5))
p <- plot_sequence_colormap(exp, data_conditions=conditions)



zentnerlab/TSRexploreR documentation built on Dec. 30, 2022, 10:27 p.m.