Package 'EthnoBotaPhyWR'

Title: Infrastructure for Ethnobotanical and Phytochemical Data Integration with Wikidata
Description: Infrastructure and curated ethnobotanical and phytochemical datasets for analyzing plant families, including phylogenetic integration and visualization tools. Includes vendored functions from the 'cascade' package (https://github.com/adafede/cascade) to minimize the dependency tree.
Authors: Adriano Rutz [aut, cre] (ORCID: <https://orcid.org/0000-0003-0443-9902>)
Maintainer: Adriano Rutz <[email protected]>
License: AGPL (>= 3)
Version: 0.0.0.9001
Built: 2026-10-28 00:03:18 UTC
Source: https://github.com/adafede/EthnoBotaPhyWR

Help Index


Ethnobota fever

Description

Collects and plots ethnobotanical and phytochemical data for a given taxon. This function performs data retrieval, merging, and logging, and produces summary statistics and outputs for downstream analysis and visualization.

Usage

ethnobotafever_tree(
  taxon_name,
  n_multiple_genera,
  n_ethnobotanical_count_min,
  n_compounds_count_min,
  example_family_names,
  path_molecules,
  path_classes,
  path_ethnobotanical,
  export_tree_full,
  export_tree_phyto,
  export_tree_phyto_sub,
  export_table_classified,
  export_table_counts,
  export_table_counts_sub,
  local_cache,
  log_dir
)

Arguments

taxon_name

Character. Name of the taxon of interest.

n_multiple_genera

Integer. Minimum number of genera for filtering.

n_ethnobotanical_count_min

Integer. Minimum ethnobotanical count for filtering.

n_compounds_count_min

Integer. Minimum compound count for filtering.

example_family_names

Character vector. Example family names for comparison.

path_molecules

Character, data.frame, or NULL. Local molecules file or table.

path_classes

Character, data.frame, or NULL. Local classes file or seed data.

path_ethnobotanical

Character, data.frame, or NULL. Local ethnobotanical file or table.

export_tree_full

Character. Path for the main full-tree PDF figure.

export_tree_phyto

Character. Path for the phytochemical overview PDF figure.

export_tree_phyto_sub

Character. Path for the species-level phytochemical PDF figure.

export_table_classified

Character. Path for the classified compounds export.

export_table_counts

Character. Path for the genus-level summary table export.

export_table_counts_sub

Character or NULL. Path for the filtered species-level counts export.

local_cache

Character. Directory containing .rda tree cache datasets (for example data-raw).

log_dir

Character. Directory for log files.

Details

This function is a pipeline for data collection, merging, and reporting. It logs progress and statistics throughout. All side effects (file writes, logs) are documented inline.

Value

A list containing the rendered plots, exported tables, and the log-file path.

Examples

NULL

Orchids Compound Classifications

Description

NPClassifier taxonomy results for SMILES strings found in Orchidaceae. Maps each unique SMILES to its pathway, superclass, class, and glycoside status.

Usage

orchids_compound_classes

Format

A data.frame with 1574 rows and 5 columns:

query

Canonical SMILES string

pathway

NPClassifier pathway classification

superclass

NPClassifier superclass classification

class

NPClassifier class classification

glycoside

Logical: whether compound is a glycoside

Details

This dataset is a deduplicated lookup table for compound classifications. Use it to quickly retrieve NPClassifier results for a given SMILES string without querying the live API.

Source

NPClassifier Web Service (https://npclassifier.gnps2.org/)

Examples

data(orchids_compound_classes)
head(orchids_compound_classes)
nrow(orchids_compound_classes)

Orchids Compound Data

Description

A dataset containing phytochemical information from Orchidaceae species. This is a curated subset linking taxonomic data, chemical structures (SMILES), and NPClassifier taxonomy.

Usage

orchids_compounds

Format

A data.frame with 3055 rows and 10 columns:

taxon

Wikidata QID (Q-identifier) for the species

taxon_name

Scientific name of the species

compound

Wikidata QID for the chemical compound

compound_smiles_canonical

Canonical SMILES representation

compound_inchikey

InChIKey chemical identifier

connectivity_layer

First block of InChIKey (connectivity skeleton)

pathway

NPClassifier pathway classification

superclass

NPClassifier superclass classification

class

NPClassifier class classification

glycoside

Logical: whether compound is a glycoside

Source

Curated from:

  • Wikidata (https://www.wikidata.org/)

  • LOTUS database (https://lotus.naturalproducts.net/)

  • NPClassifier (https://npclassifier.gnps2.org/)

Examples

data(orchids_compounds)
head(orchids_compounds)
table(orchids_compounds$superclass)

Orchids Ethnobotanical Uses

Description

A dataset of ethnobotanical uses reported for Orchidaceae species, linked to their Open Tree of Life (OTT) taxonomy identifiers.

Usage

orchids_ethnobotanical

Format

A data.frame with 419 rows and 3 columns:

taxon_name

Scientific name of the species

taxon

Wikidata QID (Q-identifier) for the species

taxon_id_ott

Open Tree of Life taxonomy identifier

Details

Each row represents a species with documented ethnobotanical uses. The taxon_id_ott field enables integration with phylogenetic analyses via the Open Tree of Life API.

Source

Wikidata (https://www.wikidata.org/) and Open Tree of Life (https://tree.opentreeoflife.org/)

Examples

data(orchids_ethnobotanical)
head(orchids_ethnobotanical)
nrow(orchids_ethnobotanical)

Cached Tree Result for Orchidaceae

Description

Precomputed tree cache generated by get_trees_cached() for the Orchidaceae pipeline. The .rda file contains a single object named trees_5141741f198446414395a45383e3a7ec.

Usage

trees_5141741f198446414395a45383e3a7ec

Format

An .rda file containing a list with:

taxa_not_in_tree

A tidytable/data.frame of taxa that were not found in the tree

tree_taxa_full

A phylo object for the full induced tree

tree_taxa_phyto

A phylo object for the phytochemical subset tree

Source

Generated by get_trees_cached() from Open Tree of Life queries.


Cached Tree Result for Orchidaceae

Description

Precomputed tree cache generated by get_trees_cached() for the Orchidaceae pipeline. The .rda file contains a single object named trees_886f2bbc1ee37e9433e35b78f5db91ef.

Usage

trees_886f2bbc1ee37e9433e35b78f5db91ef

Format

An .rda file containing a list with:

taxa_not_in_tree

A tidytable/data.frame of taxa that were not found in the tree

tree_taxa_full

A phylo object for the full induced tree

tree_taxa_phyto

A phylo object for the phytochemical subset tree

Source

Generated by get_trees_cached() from Open Tree of Life queries.


Cached Tree Result for Orchidaceae

Description

Precomputed tree cache generated by get_trees_cached() for the Orchidaceae pipeline. The .rda file contains a single object named trees_8cca7de252bc0994398aec413cebdbbc.

Usage

trees_8cca7de252bc0994398aec413cebdbbc

Format

An .rda file containing a list with:

taxa_not_in_tree

A tidytable/data.frame of taxa that were not found in the tree

tree_taxa_full

A phylo object for the full induced tree

tree_taxa_phyto

A phylo object for the phytochemical subset tree

Source

Generated by get_trees_cached() from Open Tree of Life queries.


Cached Tree Result for Orchidaceae

Description

Precomputed tree cache generated by get_trees_cached() for the Orchidaceae pipeline. The .rda file contains a single object named trees_9a06c9c148110e62a4e1d2ff8094e462.

Usage

trees_9a06c9c148110e62a4e1d2ff8094e462

Format

An .rda file containing a list with:

taxa_not_in_tree

A tidytable/data.frame of taxa that were not found in the tree

tree_taxa_full

A phylo object for the full induced tree

tree_taxa_phyto

A phylo object for the phytochemical subset tree

Source

Generated by get_trees_cached() from Open Tree of Life queries.