sort_tomic: Sort Triple Omic

sort_tomicR Documentation

Sort Triple Omic

Description

Sort a dataset's features or samples

Usage

sort_tomic(
  tomic,
  sort_type,
  sort_table,
  sort_variables = NULL,
  value_var = NULL
)

Arguments

tomic

Either a tidy_omic or triple_omic object

sort_type
hclust

Arrange samples by hierarchical clustering of a provided value_var

arrange

Arrange samples by the factor or alphanumeric ordering of a set of sort_variables

sort_table

samples or features

sort_variables

A set of attributes in sort_table to sort with in arrange.

value_var

An abundance value to use with hclust

Details

sort_tomic supports the reordering of features or samples using either hierarchical clustering or based on the levels of other variables. Sorting occurs by turning either the feature or sample primary key into a factor whose levels reflect the sort.

Value

A tomic object where feature or sample primary keys have been turned into a factor reflecting how they are sorted.

Examples


library(dplyr)

sort_tomic(brauer_2008_triple,
  sort_type = "arrange", sort_table = "samples",
  sort_variables = c("nutrient", "DR")
) %>%
  sort_tomic(
    sort_type = "hclust",
    sort_table = "features",
    value_var = "expression"
  )

romic documentation built on Sept. 21, 2023, 9:06 a.m.