prepare_taxa: Prepare taxa

View source: R/prepare_taxa.R

prepare_taxaR Documentation

Prepare taxa

Description

This function performs taxon name preparation to match the Open Tree of Life taxonomy

Usage

prepare_taxa(
  input = get_params(step = "prepare_taxa")$files$features$raw,
  extension = get_params(step = "prepare_taxa")$names$extension,
  name_features = get_params(step = "prepare_taxa")$names$features,
  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,
  top_k = get_params(step = "prepare_taxa")$organisms$candidates,
  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

File containing your features intensities

extension

Does your column names contain the file extension? (mzmine mainly)

name_features

Name of the features column in the features file

name_filename

Name of the file name column in the metadata file

colname

Name of the column containing biological source information

metadata

File containing your metadata including biological source

top_k

Number of organisms to be retained per feature top intensities

org_tax_ott

File containing Open Tree of Life Taxonomy

output

Output file

taxon

If you want to enforce all features to a given taxon, put its name here.

Details

Depending if the features are aligned between samples originating from various organisms or not, It can either attribute all features to a single organism, or attribute them to multiple ones, according to their relative intensities among the samples.

Value

The path to the prepared taxa

Examples

## Not run: 
tima:::copy_backbone()
go_to_cache()
github <- "https://raw.githubusercontent.com/"
repo <- "taxonomicallyinformedannotation/tima-example-files/main/"
dir <- paste0(github, repo)
org_tax_ott <- get_params(step = "prepare_taxa")$files$libraries$sop$merged$organisms$taxonomies$ott |>
  gsub(
    pattern = ".gz",
    replacement = "",
    fixed = TRUE
  )
get_file(url = paste0(dir, org_tax_ott), export = org_tax_ott)
get_file(
  url = get_default_paths()$urls$examples$features,
  export = get_params(step = "prepare_taxa")$files$features$raw
)
prepare_taxa(
  taxon = "Homo sapiens",
  org_tax_ott = org_tax_ott
)
unlink("data", recursive = TRUE)

## End(Not run)

taxonomicallyinformedannotation/tima-r documentation built on Dec. 20, 2024, 9:32 a.m.