Prepare taxa

Description

This function prepares taxonomic information for features by matching organism names to Open Tree of Life taxonomy. Can attribute all features to a single organism or distribute them across multiple organisms based on relative intensities in samples.

Usage

prepare_taxa(
  input = get_params(step = "prepare_taxa")\$files\$features\$prepared,
  extension = get_params(step = "prepare_taxa")\$names\$extension,
  name_filename = get_params(step = "prepare_taxa")\$names\$filename,
  colname = get_params(step = "prepare_taxa")\$names\$taxon,
  metadata = get_params(step = "prepare_taxa")\$files\$metadata\$raw,
  org_tax_ott = get_params(step =
    "prepare_taxa")\$files\$libraries\$sop\$merged\$organisms\$taxonomies\$ott,
  output = get_params(step = "prepare_taxa")\$files\$metadata\$prepared,
  taxon = get_params(step = "prepare_taxa")\$organisms\$taxon
)

Arguments

input Character string path to features file with intensities
extension Logical whether column names contain file extensions
name_filename Character string name of filename column in metadata
colname Character string name of column with biological source info
metadata Character string path to metadata file with organism info
org_tax_ott Character string path to Open Tree of Life taxonomy file
output Character string path for output file
taxon Character string organism name to enforce for all features (e.g., "Homo sapiens"). If provided, overrides metadata-based assignment.

Details

Depending on whether features are aligned between samples from various organisms, this function either: - Attributes all features to a single organism (if taxon specified), or - Attributes features to multiple organisms based on their relative intensities across samples (using metadata)

Value

Character string path to the prepared taxa file

Examples

library("tima")

copy_backbone()
go_to_cache()
github <- "https://raw.githubusercontent.com/"
repo <- "taxonomicallyinformedannotation/tima-example-files/main/"
dir <- paste0(github, repo)
org_tax_ott <- paste0(
  "data/interim/libraries/",
  "sop/merged/organisms/taxonomies/ott.tsv"
)
get_file(url = paste0(dir, org_tax_ott), export = org_tax_ott)
get_file(
  url = paste0(dir, "data/interim/features/example_features.tsv"),
  export = get_params(step = "prepare_taxa")$files$features$prepared
)
prepare_taxa(
  taxon = "Homo sapiens",
  org_tax_ott = org_tax_ott
)
unlink("data", recursive = TRUE)