quantiling: Quantiling

Description Usage Arguments Details Value See Also Examples

View source: R/data_conditionals.R

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

1
2
3
4
5
6
7
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

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

rpolicastro/tsrexplorer documentation built on Oct. 17, 2021, 3:02 p.m.