| Title: | Client for the 'UniTCM' Traditional Chinese Medicine Platform |
|---|---|
| Description: | Provides functions to query the 'UniTCM' API (<https://unitcm.qfxulab.com>), covering herb exploration, compound/ADMET (Absorption, Distribution, Metabolism, Excretion, and Toxicity) data, disease-formula associations, Traditional Chinese Medicine (TCM) ontology, transcriptomics, and gene-disease analysis (MIDAS, Mining Integrated Disease Association Sources). |
| Authors: | Xiao Zheng [aut, cre] (ORCID: <https://orcid.org/0009-0000-3918-5725>) |
| Maintainer: | Xiao Zheng <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.2 |
| Built: | 2026-05-28 15:04:05 UTC |
| Source: | https://github.com/cran/unitcm |
Return compound-target pairs (keyed by InChIKey + UniProt ID) supported
by interaction records in at least min_sources source databases.
Optionally extends each pair with DrugCLIP / SEA prediction support.
aggregated_target2np( search = NULL, target_organism = NULL, min_sources = 2L, include_predictions = FALSE, page = 1L, page_size = 20L )aggregated_target2np( search = NULL, target_organism = NULL, min_sources = 2L, include_predictions = FALSE, page = 1L, page_size = 20L )
search |
Free-text search query. |
target_organism |
Optional target organism filter. |
min_sources |
Minimum number of source databases supporting the pair (1-5, default 2). |
include_predictions |
If |
page |
Page number (default 1). |
page_size |
Results per page (default 20, max 50). |
A tibble::tibble() of aggregated pairs with attribute "total".
## Not run: aggregated_target2np(search = "quercetin") aggregated_target2np(search = "TP53", min_sources = 3, include_predictions = TRUE) ## End(Not run)## Not run: aggregated_target2np(search = "quercetin") aggregated_target2np(search = "TP53", min_sources = 3, include_predictions = TRUE) ## End(Not run)
Convert a NetVis graph response to igraph
as_igraph(graph_response)as_igraph(graph_response)
graph_response |
A list with |
An igraph graph object.
## Not run: resp <- get_neighbors("H:UNITCM_H001") g <- as_igraph(resp) ## End(Not run)## Not run: resp <- get_neighbors("H:UNITCM_H001") g <- as_igraph(resp) ## End(Not run)
Convert a NetVis graph response to tidygraph
as_tidygraph(graph_response)as_tidygraph(graph_response)
graph_response |
A list with |
A tidygraph::tbl_graph object.
## Not run: resp <- get_neighbors("H:UNITCM_H001") tg <- as_tidygraph(resp) ## End(Not run)## Not run: resp <- get_neighbors("H:UNITCM_H001") tg <- as_tidygraph(resp) ## End(Not run)
Search for disease names with autocomplete. Query must be at least 2 characters.
autocomplete_disease(q)autocomplete_disease(q)
q |
Search query (minimum 2 characters). |
A tibble::tibble() with columns: disease_name, disease_id,
gene_count.
## Not run: autocomplete_disease("breast") ## End(Not run)## Not run: autocomplete_disease("breast") ## End(Not run)
Look up interaction records for up to 50 gene symbols, UniProt IDs, or Entrez gene IDs in one call.
batch_target2np( identifiers, id_type = c("gene_symbol", "uniprot_id", "entrez_gene_id") )batch_target2np( identifiers, id_type = c("gene_symbol", "uniprot_id", "entrez_gene_id") )
identifiers |
Character vector of identifiers (max 50). |
id_type |
One of |
A tibble::tibble() of matching records with attributes
"total", "queries_matched", and "queries_not_found".
## Not run: batch_target2np(c("TP53", "BRCA1", "EGFR")) batch_target2np(c("P04637", "P38398"), id_type = "uniprot_id") ## End(Not run)## Not run: batch_target2np(c("TP53", "BRCA1", "EGFR")) batch_target2np(c("P04637", "P38398"), id_type = "uniprot_id") ## End(Not run)
Given a formula order ID, fetches its herb doses and constructs a star-topology network.
build_formula_herb_network(formula_id)build_formula_herb_network(formula_id)
formula_id |
The formula order ID (integer or character). |
An igraph graph object with vertex attributes name, type
("formula", "herb"), label, and dose (for herbs).
## Not run: g <- build_formula_herb_network(1) igraph::V(g)$label ## End(Not run)## Not run: g <- build_formula_herb_network(1) igraph::V(g)$label ## End(Not run)
Given herb names or IDs, fetches herb-compound-target data from the API
and constructs a typed igraph network.
build_hct_network( herbs, target_method = "drugclip", max_compounds = 50L, progress = TRUE )build_hct_network( herbs, target_method = "drugclip", max_compounds = 50L, progress = TRUE )
herbs |
Character vector of herb names or UniTCM herb IDs. |
target_method |
Target prediction method passed to
|
max_compounds |
Maximum compounds per herb to include (default 50). |
progress |
Show progress messages (default |
An igraph graph object with vertex attributes name, type
("herb", "compound", "target"), and label.
## Not run: g <- build_hct_network(c("UNITCM_H001", "UNITCM_H002")) igraph::vcount(g) ## End(Not run)## Not run: g <- build_hct_network(c("UNITCM_H001", "UNITCM_H002")) igraph::vcount(g) ## End(Not run)
Removes the API key from session memory and optionally from the system keyring.
clear_api_key(keyring = FALSE)clear_api_key(keyring = FALSE)
keyring |
Logical. If |
Invisible NULL.
## Not run: clear_api_key() ## End(Not run)## Not run: clear_api_key() ## End(Not run)
Removes the token from session memory and optionally from the system keyring.
clear_unitcm_token(keyring = FALSE)clear_unitcm_token(keyring = FALSE)
keyring |
Logical. If |
Invisible NULL.
## Not run: clear_unitcm_token() ## End(Not run)## Not run: clear_unitcm_token() ## End(Not run)
Convert a mixed list of gene identifiers (symbols, Entrez IDs, Ensembl IDs) to a standardized mapping.
convert_gene_ids(identifiers)convert_gene_ids(identifiers)
identifiers |
Character vector of gene identifiers. |
A tibble::tibble() with columns including match status.
## Not run: convert_gene_ids(c("TP53", "7157", "ENSG00000141510")) ## End(Not run)## Not run: convert_gene_ids(c("TP53", "7157", "ENSG00000141510")) ## End(Not run)
POST a graph (nodes + edges) to the server for community detection.
detect_communities(nodes, edges)detect_communities(nodes, edges)
nodes |
Character vector of node IDs. |
edges |
A data frame or list of edges, each with |
A tibble::tibble() with columns node_id and community_id.
## Not run: detect_communities( nodes = c("A", "B", "C"), edges = data.frame(source = c("A", "B"), target = c("B", "C")) ) ## End(Not run)## Not run: detect_communities( nodes = c("A", "B", "C"), edges = data.frame(source = c("A", "B"), target = c("B", "C")) ) ## End(Not run)
Download a CSV of a specific data module for one compound.
export_compound_module( id, module = c("overview", "physicochemical", "admet", "targets"), file = NULL )export_compound_module( id, module = c("overview", "physicochemical", "admet", "targets"), file = NULL )
id |
The UniTCM ingredient ID. |
module |
One of |
file |
Output file path (auto-generated if |
Invisible file path.
## Not run: export_compound_module("UNITCM_I00001", "admet") ## End(Not run)## Not run: export_compound_module("UNITCM_I00001", "admet") ## End(Not run)
Download a CSV export of compounds matching the given filters (max 10,000 rows).
export_compounds( q = NULL, mw_min = NULL, mw_max = NULL, clogp_min = NULL, clogp_max = NULL, tpsa_min = NULL, tpsa_max = NULL, qed_min = NULL, qed_max = NULL, ring_count_min = NULL, ring_count_max = NULL, lipinski = NULL, is_drug = NULL, sort = NULL, file = "compounds_export.csv" )export_compounds( q = NULL, mw_min = NULL, mw_max = NULL, clogp_min = NULL, clogp_max = NULL, tpsa_min = NULL, tpsa_max = NULL, qed_min = NULL, qed_max = NULL, ring_count_min = NULL, ring_count_max = NULL, lipinski = NULL, is_drug = NULL, sort = NULL, file = "compounds_export.csv" )
q |
Search query (name, SMILES, formula, or CAS number). |
mw_min, mw_max
|
Molecular weight range. |
clogp_min, clogp_max
|
CLogP range. |
tpsa_min, tpsa_max
|
Topological polar surface area range. |
qed_min, qed_max
|
QED score range. |
ring_count_min, ring_count_max
|
Ring count range. |
lipinski |
Lipinski rule filter (character vector, comma-collapsed). |
is_drug |
Approved drug filter (logical or |
sort |
Sort field (e.g. |
file |
Output file path (default |
Invisible file path.
## Not run: export_compounds(mw_min = 200, file = "filtered_compounds.csv") ## End(Not run)## Not run: export_compounds(mw_min = 200, file = "filtered_compounds.csv") ## End(Not run)
Download a CSV export of datasets matching the given filters.
export_datasets( q = NULL, tcm = NULL, omics = NULL, source = NULL, organism = NULL, tissue = NULL, disease = NULL, repo = NULL, year_min = NULL, year_max = NULL, sort = NULL, file = "datasets_export.csv" )export_datasets( q = NULL, tcm = NULL, omics = NULL, source = NULL, organism = NULL, tissue = NULL, disease = NULL, repo = NULL, year_min = NULL, year_max = NULL, sort = NULL, file = "datasets_export.csv" )
q |
Optional search query string. |
tcm |
TCM classification filter. |
omics |
Omics type filter. |
source |
Source type filter. |
organism |
Organism filter. |
tissue |
Tissue filter. |
disease |
Disease filter. |
repo |
Repository filter. |
year_min |
Minimum publication year. |
year_max |
Maximum publication year. |
sort |
Sort field: |
file |
Output file path (default |
Invisible file path.
## Not run: export_datasets(omics = "Transcriptomics", file = "transcriptomics.csv") ## End(Not run)## Not run: export_datasets(omics = "Transcriptomics", file = "transcriptomics.csv") ## End(Not run)
Download a CSV export of all compounds for a specific herb.
export_herb_compounds(herb_id, file = "herb_compounds_export.csv")export_herb_compounds(herb_id, file = "herb_compounds_export.csv")
herb_id |
The UniTCM herb ID. |
file |
Output file path (default |
Invisible file path.
## Not run: export_herb_compounds("UNITCM_H001") ## End(Not run)## Not run: export_herb_compounds("UNITCM_H001") ## End(Not run)
Download a CSV export of herbs matching the given filters.
export_herbs( q = NULL, therapeutic_en = NULL, therapeutic_cn = NULL, family = NULL, toxicity = NULL, source = NULL, flavors = NULL, properties = NULL, meridians = NULL, medicinal_part = NULL, file = "herbs_export.csv" )export_herbs( q = NULL, therapeutic_en = NULL, therapeutic_cn = NULL, family = NULL, toxicity = NULL, source = NULL, flavors = NULL, properties = NULL, meridians = NULL, medicinal_part = NULL, file = "herbs_export.csv" )
q |
Optional search query string. |
therapeutic_en |
English therapeutic classification filter (character vector). |
therapeutic_cn |
Chinese therapeutic classification filter (character vector). |
family |
Botanical family filter (character vector). |
toxicity |
Toxicity level filter (character vector). |
source |
Data source filter (character vector). |
flavors |
Flavor filter (character vector). |
properties |
Property filter (character vector). |
meridians |
Meridian tropism filter (character vector). |
medicinal_part |
Medicinal part filter (character vector). |
file |
Output file path (default |
Invisible file path.
## Not run: export_herbs(q = "ginseng", file = "ginseng_herbs.csv") ## End(Not run)## Not run: export_herbs(q = "ginseng", file = "ginseng_herbs.csv") ## End(Not run)
Download the full ontology in JSON, OWL/RDF, or CSV format.
export_ontology(format = c("json", "owl", "csv"), file = NULL, depth = 4L)export_ontology(format = c("json", "owl", "csv"), file = NULL, depth = 4L)
format |
Export format: |
file |
Output file path. If |
depth |
Tree depth for JSON export (default 4). |
Invisible file path.
## Not run: export_ontology("csv") export_ontology("json", depth = 2, file = "ontology_shallow.json") ## End(Not run)## Not run: export_ontology("csv") export_ontology("json", depth = 2, file = "ontology_shallow.json") ## End(Not run)
Returns summary statistics and filter option counts for the Ingredient Explorer.
fetch_compound_facets()fetch_compound_facets()
A named list with fields: total, approved_count,
lipinski_counts, drug_counts, mw_range, clogp_range,
tpsa_range, qed_range.
## Not run: fetch_compound_facets() ## End(Not run)## Not run: fetch_compound_facets() ## End(Not run)
Returns available filter values and their counts for the TCMomics database.
fetch_dataset_facets()fetch_dataset_facets()
A named list of tibbles for each facet field.
## Not run: facets <- fetch_dataset_facets() facets$omics_type ## End(Not run)## Not run: facets <- fetch_dataset_facets() facets$omics_type ## End(Not run)
Get TCMomics database statistics
fetch_dataset_stats()fetch_dataset_stats()
A named list with fields: total_datasets, total_downloads,
omics_types_count, unique_organisms.
## Not run: fetch_dataset_stats() ## End(Not run)## Not run: fetch_dataset_stats() ## End(Not run)
Returns the full 4-level ICD-11 disease classification tree used by the Disease-Formula Atlas.
fetch_disease_tree()fetch_disease_tree()
A recursive nested list with structure
list(label, count, children = list(...)).
## Not run: tree <- fetch_disease_tree() names(tree[[1]]) ## End(Not run)## Not run: tree <- fetch_disease_tree() names(tree[[1]]) ## End(Not run)
Returns available filter values and their counts for the Herb Explorer.
fetch_herb_facets()fetch_herb_facets()
A named list of tibbles, one per facet field
(e.g. therapeutic_en_class, family, toxicity).
## Not run: facets <- fetch_herb_facets() facets$toxicity ## End(Not run)## Not run: facets <- fetch_herb_facets() facets$toxicity ## End(Not run)
Get homepage statistics
fetch_home_stats()fetch_home_stats()
A named list with fields: total_datasets, total_downloads,
total_file_size, recent_submissions_count.
## Not run: fetch_home_stats() ## End(Not run)## Not run: fetch_home_stats() ## End(Not run)
Get latest submissions
fetch_latest_submissions()fetch_latest_submissions()
A tibble::tibble() of recent submissions with columns:
submission_id, project_title, submitted_by, updated_at,
institution, total_file_size.
## Not run: fetch_latest_submissions() ## End(Not run)## Not run: fetch_latest_submissions() ## End(Not run)
Fetches all 6 filter option endpoints and returns them as a named list of tibbles.
fetch_mechanism_filters()fetch_mechanism_filters()
A named list with elements: categories, omics_types,
evidence_levels, confidence_levels, study_types, species.
Each is a tibble::tibble() with columns value, label, count.
## Not run: filters <- fetch_mechanism_filters() filters$categories ## End(Not run)## Not run: filters <- fetch_mechanism_filters() filters$categories ## End(Not run)
List all available gene-disease association databases.
fetch_midas_sources()fetch_midas_sources()
A tibble::tibble() with columns: key, label, has_score,
weight, row_count.
## Not run: fetch_midas_sources() ## End(Not run)## Not run: fetch_midas_sources() ## End(Not run)
Get MIDAS statistics
fetch_midas_stats()fetch_midas_stats()
A named list with fields: total_associations, total_genes,
total_diseases, sources.
## Not run: fetch_midas_stats() ## End(Not run)## Not run: fetch_midas_stats() ## End(Not run)
Get NetVis network statistics
fetch_netvis_stats()fetch_netvis_stats()
A named list with node counts (formula, herb, compound,
target, disease) and edges sub-list.
## Not run: fetch_netvis_stats() ## End(Not run)## Not run: fetch_netvis_stats() ## End(Not run)
Get omics type statistics
fetch_omics_type_stats()fetch_omics_type_stats()
A tibble::tibble() with columns: omics_type, count,
percentage.
## Not run: fetch_omics_type_stats() ## End(Not run)## Not run: fetch_omics_type_stats() ## End(Not run)
Fetch ontology statistics
fetch_ontology_stats()fetch_ontology_stats()
A named list with fields: total_entities, total_level1–
total_level4, total_relations, total_mappings, categories.
## Not run: fetch_ontology_stats() ## End(Not run)## Not run: fetch_ontology_stats() ## End(Not run)
Returns the full ontology as a recursive nested list.
fetch_ontology_tree(depth = 4L)fetch_ontology_tree(depth = 4L)
depth |
Tree depth to return (1–10, default 4). |
A recursive nested list: list(tcm_id, name, name_cn, level, children = list(...)).
## Not run: tree <- fetch_ontology_tree(depth = 2) ## End(Not run)## Not run: tree <- fetch_ontology_tree(depth = 2) ## End(Not run)
Returns the controlled values used by the Target2NP filter UI (source databases, evidence labels, top target organisms, interaction types, and top activity types).
fetch_target2np_filters()fetch_target2np_filters()
A named list with fields source_db, evidence_label,
target_organism, interaction_type, activity_type.
## Not run: opts <- fetch_target2np_filters() opts$source_db ## End(Not run)## Not run: opts <- fetch_target2np_filters() opts$source_db ## End(Not run)
Returns counts and distributions across source databases, evidence levels, target organisms, and activity types.
fetch_target2np_stats()fetch_target2np_stats()
A named list with total_records and four distribution lists.
## Not run: stats <- fetch_target2np_stats() stats$total_records ## End(Not run)## Not run: stats <- fetch_target2np_stats() stats$total_records ## End(Not run)
Get TCM classification statistics
fetch_tcm_classification_stats()fetch_tcm_classification_stats()
A tibble::tibble() with columns: classification, count,
percentage.
## Not run: fetch_tcm_classification_stats() ## End(Not run)## Not run: fetch_tcm_classification_stats() ## End(Not run)
Get transcriptome filter options
fetch_transcriptome_filters()fetch_transcriptome_filters()
A named list of character vectors for each filter field.
## Not run: filters <- fetch_transcriptome_filters() filters$organism ## End(Not run)## Not run: filters <- fetch_transcriptome_filters() filters$organism ## End(Not run)
Get Transcriptome Hub statistics
fetch_transcriptome_stats()fetch_transcriptome_stats()
A named list with fields: total_datasets, total_organisms,
total_tcm_entities, total_analysis_modules, plus distribution data.
## Not run: fetch_transcriptome_stats() ## End(Not run)## Not run: fetch_transcriptome_stats() ## End(Not run)
Find shortest path between two nodes
find_path(source, target, max_depth = 4L)find_path(source, target, max_depth = 4L)
source |
Source node ID. |
target |
Target node ID. |
max_depth |
Maximum path depth (max 8, default 4). |
A named list with $nodes (tibble::tibble()) and $edges
(tibble::tibble()).
## Not run: find_path("H:UNITCM_H001", "T:TP53") ## End(Not run)## Not run: find_path("H:UNITCM_H001", "T:TP53") ## End(Not run)
Recursively flattens a nested list into a single-row tibble. Nested lists that cannot be further flattened are kept as list-columns.
flatten_response(x)flatten_response(x)
x |
A named list from an API response. |
A single-row tibble::tibble().
## Not run: herb <- get_herb("UNITCM_H001") flatten_response(herb) ## End(Not run)## Not run: herb <- get_herb("UNITCM_H001") flatten_response(herb) ## End(Not run)
Retrieve data for a specific analysis module. Return type varies by module.
get_analysis_data(dataset_id, module, gene = NULL)get_analysis_data(dataset_id, module, gene = NULL)
dataset_id |
The dataset ID. |
module |
Analysis module name. One of: |
gene |
Optional gene filter (for expression module only). |
A tibble::tibble() for tabular modules (deg, go, kegg, gsea,
immune, tf), or a named list for structured modules (meta, expression,
ppi, pca, qc).
## Not run: get_analysis_data("TCMtrans00001", "deg") get_analysis_data("TCMtrans00001", "expression", gene = "TP53") ## End(Not run)## Not run: get_analysis_data("TCMtrans00001", "deg") get_analysis_data("TCMtrans00001", "expression", gene = "TP53") ## End(Not run)
List available analysis modules for a dataset
get_analysis_modules(dataset_id)get_analysis_modules(dataset_id)
dataset_id |
The dataset ID. |
A character vector of available module names.
## Not run: get_analysis_modules("TCMtrans00001") ## End(Not run)## Not run: get_analysis_modules("TCMtrans00001") ## End(Not run)
Checks in order: (1) session value set via set_api_key(),
(2) environment variable UNITCM_API_KEY, (3) system keyring.
get_api_key()get_api_key()
A character string, or NULL if no API key is found.
## Not run: get_api_key() ## End(Not run)## Not run: get_api_key() ## End(Not run)
Checks in order: (1) session value set via set_base_url(),
(2) option unitcm.base_url, (3) environment variable UNITCM_BASE_URL,
(4) hardcoded default.
get_base_url()get_base_url()
A character string.
## Not run: get_base_url() ## End(Not run)## Not run: get_base_url() ## End(Not run)
Retrieve full detail for one compound including cross-references.
get_compound(id)get_compound(id)
id |
The UniTCM ingredient ID (e.g. |
A named list with 26+ fields including an xref sub-list.
## Not run: get_compound("UNITCM_I00001") ## End(Not run)## Not run: get_compound("UNITCM_I00001") ## End(Not run)
Returns ~90 ADMET endpoint predictions as a single-row wide tibble.
get_compound_admet(id)get_compound_admet(id)
id |
The UniTCM ingredient ID. |
A single-row tibble::tibble() with ~90 ADMET columns.
## Not run: get_compound_admet("UNITCM_I00001") ## End(Not run)## Not run: get_compound_admet("UNITCM_I00001") ## End(Not run)
List herbs that contain a specific compound.
get_compound_herbs(id, page = 1L, page_size = 20L, all_pages = FALSE)get_compound_herbs(id, page = 1L, page_size = 20L, all_pages = FALSE)
id |
The UniTCM ingredient ID. |
page |
Page number (default 1). |
page_size |
Results per page (default 20). |
all_pages |
If |
A tibble::tibble() of herbs with attribute "total".
## Not run: get_compound_herbs("UNITCM_I00001") ## End(Not run)## Not run: get_compound_herbs("UNITCM_I00001") ## End(Not run)
Retrieve target predictions from DrugCLIP, ChEMBL similarity search, or both.
get_compound_targets( id, method = c("drugclip", "chembl", "both"), page = 1L, page_size = 20L )get_compound_targets( id, method = c("drugclip", "chembl", "both"), page = 1L, page_size = 20L )
id |
The UniTCM ingredient ID. |
method |
One of |
page |
Page number (for ChEMBL targets, default 1). |
page_size |
Results per page (for ChEMBL targets, default 20). |
A tibble::tibble() of targets. When method = "both", a
source column is added to distinguish results.
## Not run: get_compound_targets("UNITCM_I00001") get_compound_targets("UNITCM_I00001", method = "both") ## End(Not run)## Not run: get_compound_targets("UNITCM_I00001") get_compound_targets("UNITCM_I00001", method = "both") ## End(Not run)
Retrieve full detail including nested persons, publications, grants, and data files.
get_dataset(submission_id)get_dataset(submission_id)
submission_id |
The submission ID (e.g. |
A named list with nested sub-lists for persons, publications,
grants, and data_files.
## Not run: get_dataset("TMA2025001") ## End(Not run)## Not run: get_dataset("TMA2025001") ## End(Not run)
Retrieve full detail for one formula from the Disease-Formula Atlas.
get_formula(order_id)get_formula(order_id)
order_id |
The formula order ID (integer or character). |
A named list with 30+ fields.
## Not run: get_formula(1) ## End(Not run)## Not run: get_formula(1) ## End(Not run)
Retrieve the composition and dosage information for a specific formula.
get_formula_doses(order_id)get_formula_doses(order_id)
order_id |
The formula order ID. |
A tibble::tibble() with columns: id, herb_name,
original_dose, composition_ratio, modern_dose_g,
clinical_ref_dose_g, dynasty, notes, herb_ids.
## Not run: get_formula_doses(1) ## End(Not run)## Not run: get_formula_doses(1) ## End(Not run)
Retrieve full detail for one herb from the Herb Explorer.
get_herb(herb_id)get_herb(herb_id)
herb_id |
The UniTCM herb ID (e.g. |
A named list with 31 fields including cross-reference IDs.
## Not run: get_herb("UNITCM_H001") ## End(Not run)## Not run: get_herb("UNITCM_H001") ## End(Not run)
List chemical compounds (ingredients) associated with a specific herb.
get_herb_compounds(herb_id, page = 1L, page_size = 20L, all_pages = FALSE)get_herb_compounds(herb_id, page = 1L, page_size = 20L, all_pages = FALSE)
herb_id |
The UniTCM herb ID. |
page |
Page number (default 1). |
page_size |
Results per page (default 20). |
all_pages |
If |
A tibble::tibble() of compounds with attribute "total".
## Not run: get_herb_compounds("UNITCM_H001") ## End(Not run)## Not run: get_herb_compounds("UNITCM_H001") ## End(Not run)
Retrieve full detail for one term including nested arrays of biomarkers, pathways, gene targets, metabolites, etc.
get_mechanism(term_id)get_mechanism(term_id)
term_id |
The mechanism term ID. |
A named list with ~50 fields. Nested arrays (e.g. biomarkers,
signaling_pathways, gene_targets) are returned as-is (lists).
## Not run: get_mechanism("TMM001") ## End(Not run)## Not run: get_mechanism("TMM001") ## End(Not run)
Get neighbors of a node
get_neighbors(node_id, depth = 1L, limit = 50L, node_types = NULL)get_neighbors(node_id, depth = 1L, limit = 50L, node_types = NULL)
node_id |
Node ID (e.g. |
depth |
Neighbor depth (1–3, default 1). |
limit |
Maximum neighbors (max 200, default 50). |
node_types |
Comma-separated node types to include. |
A named list with $nodes (tibble::tibble()), $edges
(tibble::tibble()), and $has_more.
## Not run: get_neighbors("H:UNITCM_H001", depth = 1) ## End(Not run)## Not run: get_neighbors("H:UNITCM_H001", depth = 1) ## End(Not run)
Get node detail
get_node_detail(node_id)get_node_detail(node_id)
node_id |
Node ID. |
A named list with fields: id, type, label, label_cn,
properties, detail_url.
## Not run: get_node_detail("H:UNITCM_H001") ## End(Not run)## Not run: get_node_detail("H:UNITCM_H001") ## End(Not run)
Get node metrics
get_node_metrics(node_id)get_node_metrics(node_id)
node_id |
Node ID. |
A named list with fields: node_id, degree, neighbor_types.
## Not run: get_node_metrics("H:UNITCM_H001") ## End(Not run)## Not run: get_node_metrics("H:UNITCM_H001") ## End(Not run)
Get ancestors of an ontology entity
get_ontology_ancestors(tcm_id)get_ontology_ancestors(tcm_id)
tcm_id |
The TCM ontology ID. |
A tibble::tibble() with columns: tcm_id, name, name_cn,
level.
## Not run: get_ontology_ancestors("TCM_0001") ## End(Not run)## Not run: get_ontology_ancestors("TCM_0001") ## End(Not run)
Get ontology entities by level
get_ontology_by_level(level, parent_id = NULL)get_ontology_by_level(level, parent_id = NULL)
level |
Ontology level (integer, 1–4). |
parent_id |
Optional parent entity ID to filter by. |
## Not run: get_ontology_by_level(2) ## End(Not run)## Not run: get_ontology_by_level(2) ## End(Not run)
Get children of an ontology entity
get_ontology_children(tcm_id)get_ontology_children(tcm_id)
tcm_id |
The TCM ontology ID. |
A tibble::tibble() with columns: tcm_id, name, name_cn,
level, path, children_count, has_children.
## Not run: get_ontology_children("TCM_0001") ## End(Not run)## Not run: get_ontology_children("TCM_0001") ## End(Not run)
Get all descendants of an ontology entity
get_ontology_descendants(tcm_id, max_level = NULL)get_ontology_descendants(tcm_id, max_level = NULL)
tcm_id |
The TCM ontology ID. |
max_level |
Maximum depth to descend (integer or |
## Not run: get_ontology_descendants("TCM_0001", max_level = 2) ## End(Not run)## Not run: get_ontology_descendants("TCM_0001", max_level = 2) ## End(Not run)
Retrieve full detail for one entity including ancestors, children, external mappings, and relations.
get_ontology_entity(tcm_id)get_ontology_entity(tcm_id)
tcm_id |
The TCM ontology ID (e.g. |
A named list with sub-elements: ancestors, children,
external_mappings, relations.
## Not run: get_ontology_entity("TCM_0001") ## End(Not run)## Not run: get_ontology_entity("TCM_0001") ## End(Not run)
Find datasets similar to a given submission based on content similarity.
get_similar_datasets(submission_id)get_similar_datasets(submission_id)
submission_id |
The submission ID. |
A tibble::tibble() with columns: submission_id,
project_title, TCM_classification, similarity_score.
## Not run: get_similar_datasets("TMA2025001") ## End(Not run)## Not run: get_similar_datasets("TMA2025001") ## End(Not run)
Get subgraph for a set of nodes
get_subgraph(node_ids, limit = 200L)get_subgraph(node_ids, limit = 200L)
node_ids |
Character vector of node IDs (max 50). |
limit |
Maximum edges (default 200). |
A named list with $nodes (tibble::tibble()), $edges
(tibble::tibble()), and $has_more.
## Not run: get_subgraph(c("H:UNITCM_H001", "C:UNITCM_I00001")) ## End(Not run)## Not run: get_subgraph(c("H:UNITCM_H001", "C:UNITCM_I00001")) ## End(Not run)
Retrieve the full detail for one compound-target interaction record.
get_target2np(record_id)get_target2np(record_id)
record_id |
Integer record ID. |
A named list of interaction fields.
## Not run: get_target2np(1) ## End(Not run)## Not run: get_target2np(1) ## End(Not run)
Retrieve full detail for one term from the TCM Bilingual Corpus.
get_term(term_id)get_term(term_id)
term_id |
The term ID. |
A named list with fields including chinese_name, pinyin,
english_name, latin_name, description_english, etc.
## Not run: get_term("TCM_T001") ## End(Not run)## Not run: get_term("TCM_T001") ## End(Not run)
Get a single transcriptome dataset
get_transcriptome(dataset_id)get_transcriptome(dataset_id)
dataset_id |
The dataset ID (e.g. |
A named list with 35+ fields.
## Not run: get_transcriptome("TCMtrans00001") ## End(Not run)## Not run: get_transcriptome("TCMtrans00001") ## End(Not run)
Checks in order: (1) session value set via set_unitcm_token(),
(2) environment variable UNITCM_TOKEN, (3) system keyring.
get_unitcm_token()get_unitcm_token()
A character string, or NULL if no token is found.
## Not run: get_unitcm_token() ## End(Not run)## Not run: get_unitcm_token() ## End(Not run)
List book sources
list_book_sources()list_book_sources()
A tibble::tibble() with columns value, label, count.
## Not run: list_book_sources() ## End(Not run)## Not run: list_book_sources() ## End(Not run)
Returns the top 50 dosage forms by frequency.
list_dosage_forms()list_dosage_forms()
A tibble::tibble() with columns value, label, count.
## Not run: list_dosage_forms() ## End(Not run)## Not run: list_dosage_forms() ## End(Not run)
List top-level ontology categories
list_ontology_categories()list_ontology_categories()
A tibble::tibble() of level-1 entities.
## Not run: list_ontology_categories() ## End(Not run)## Not run: list_ontology_categories() ## End(Not run)
Returns the top 50 formula origin sources by frequency.
list_origin_sources()list_origin_sources()
A tibble::tibble() with columns value, label, count.
## Not run: list_origin_sources() ## End(Not run)## Not run: list_origin_sources() ## End(Not run)
List term categories
list_term_categories()list_term_categories()
A tibble::tibble() with columns value, label, count.
## Not run: list_term_categories() ## End(Not run)## Not run: list_term_categories() ## End(Not run)
List term sources
list_term_sources()list_term_sources()
A tibble::tibble() with columns value, label, count.
## Not run: list_term_sources() ## End(Not run)## Not run: list_term_sources() ## End(Not run)
Create a radar/spider chart of normalized physicochemical properties for a compound.
plot_compound_radar( compound_id, properties = c("mw", "clogp", "tpsa", "hbd", "hba", "qed_score") )plot_compound_radar( compound_id, properties = c("mw", "clogp", "tpsa", "hbd", "hba", "qed_score") )
compound_id |
The UniTCM ingredient ID. |
properties |
Character vector of property names to plot (default: key drug-likeness properties). |
A ggplot object.
## Not run: plot_compound_radar("UNITCM_I00001") ## End(Not run)## Not run: plot_compound_radar("UNITCM_I00001") ## End(Not run)
Create a dot plot or bar plot from enrichment analysis results
(e.g. from query_disease_enrichment()).
plot_enrichment( enrichment_result, type = c("dotplot", "barplot"), top_n = 20L, name_col = NULL, pvalue_col = NULL, count_col = NULL )plot_enrichment( enrichment_result, type = c("dotplot", "barplot"), top_n = 20L, name_col = NULL, pvalue_col = NULL, count_col = NULL )
enrichment_result |
A |
type |
Plot type: |
top_n |
Number of top terms to show (default 20). |
name_col |
Column name for term labels (auto-detected if |
pvalue_col |
Column name for p-values (auto-detected if |
count_col |
Column name for gene counts (auto-detected if |
A ggplot object.
## Not run: enrich <- query_disease_enrichment(c("TP53", "BRCA1", "EGFR")) plot_enrichment(enrich) ## End(Not run)## Not run: enrich <- query_disease_enrichment(c("TP53", "BRCA1", "EGFR")) plot_enrichment(enrich) ## End(Not run)
Visualize an igraph or tbl_graph object using ggraph.
plot_network( graph, layout = "fr", color_by = "type", node_size = 3, edge_alpha = 0.3, show_labels = NULL )plot_network( graph, layout = "fr", color_by = "type", node_size = 3, edge_alpha = 0.3, show_labels = NULL )
graph |
An |
layout |
Layout algorithm (default |
color_by |
Vertex attribute name to map to node color (default
|
node_size |
Base node size (default 3). |
edge_alpha |
Edge transparency (default 0.3). |
show_labels |
Whether to label nodes (default |
A ggplot object.
## Not run: g <- build_hct_network("UNITCM_H001") plot_network(g) ## End(Not run)## Not run: g <- build_hct_network("UNITCM_H001") plot_network(g) ## End(Not run)
Perform Fisher's exact test enrichment analysis to identify diseases significantly associated with a gene list.
query_disease_enrichment( gene_list, gene_id_type = "symbol", sources = NULL, min_sources = 1L, background_gene_count = 20000L, p_value_cutoff = 0.05, correction_method = "fdr", min_hit_count = 2L, page = 1L, page_size = 20L )query_disease_enrichment( gene_list, gene_id_type = "symbol", sources = NULL, min_sources = 1L, background_gene_count = 20000L, p_value_cutoff = 0.05, correction_method = "fdr", min_hit_count = 2L, page = 1L, page_size = 20L )
gene_list |
Character vector of gene identifiers. |
gene_id_type |
ID type: |
sources |
Character vector of source databases (or |
min_sources |
Minimum supporting sources (default 1). |
background_gene_count |
Background gene count (default 20000). |
p_value_cutoff |
P-value significance cutoff (default 0.05). |
correction_method |
P-value correction: |
min_hit_count |
Minimum gene hits per disease (default 2). |
page |
Page number (default 1). |
page_size |
Results per page (default 20). |
A tibble::tibble() of enrichment results with attributes
"total_significant", "total_tested", and "input_gene_count".
## Not run: query_disease_enrichment(c("TP53", "BRCA1", "EGFR", "VEGFA")) ## End(Not run)## Not run: query_disease_enrichment(c("TP53", "BRCA1", "EGFR", "VEGFA")) ## End(Not run)
Given a disease query, find associated genes across multiple evidence sources.
query_disease_genes( disease_query, disease_id_type = "name", sources = NULL, min_sources = 1L, scoring_method = "max", page = 1L, page_size = 20L )query_disease_genes( disease_query, disease_id_type = "name", sources = NULL, min_sources = 1L, scoring_method = "max", page = 1L, page_size = 20L )
disease_query |
Disease name or ID. |
disease_id_type |
ID type: |
sources |
Character vector of source databases (or |
min_sources |
Minimum supporting sources (default 1). |
scoring_method |
Scoring method: |
page |
Page number (default 1). |
page_size |
Results per page (default 20). |
A tibble::tibble() of disease-gene associations with attribute
"matched_diseases".
## Not run: query_disease_genes("breast cancer") ## End(Not run)## Not run: query_disease_genes("breast cancer") ## End(Not run)
Find genes shared across multiple diseases.
query_disease_intersection(disease_queries, sources = NULL)query_disease_intersection(disease_queries, sources = NULL)
disease_queries |
Character vector of disease names/IDs. |
sources |
Character vector of source databases (or |
A named list with elements: $diseases, $per_source,
$targets, $total_intersection_genes.
## Not run: query_disease_intersection(c("breast cancer", "lung cancer")) ## End(Not run)## Not run: query_disease_intersection(c("breast cancer", "lung cancer")) ## End(Not run)
Given a list of gene symbols or IDs, find associated diseases across multiple evidence sources.
query_gene_diseases( gene_list, gene_id_type = "symbol", sources = NULL, min_sources = 1L, min_score = 0, evidence_types = NULL, scoring_method = "max", page = 1L, page_size = 20L )query_gene_diseases( gene_list, gene_id_type = "symbol", sources = NULL, min_sources = 1L, min_score = 0, evidence_types = NULL, scoring_method = "max", page = 1L, page_size = 20L )
gene_list |
Character vector of gene identifiers. |
gene_id_type |
ID type: |
sources |
Character vector of source databases to query (or |
min_sources |
Minimum number of sources supporting an association (default 1). |
min_score |
Minimum association score (default 0). |
evidence_types |
Character vector of evidence types to filter by. |
scoring_method |
Scoring method: |
page |
Page number (default 1). |
page_size |
Results per page (default 20). |
A tibble::tibble() of gene-disease associations with attribute
"gene_mapping" containing the gene ID resolution mapping.
## Not run: query_gene_diseases(c("TP53", "BRCA1")) ## End(Not run)## Not run: query_gene_diseases(c("TP53", "BRCA1")) ## End(Not run)
Compare how different evidence sources cover a gene list, producing Venn-diagram-ready set data.
query_source_comparison( gene_list, sources = NULL, mode = c("union", "intersection") )query_source_comparison( gene_list, sources = NULL, mode = c("union", "intersection") )
gene_list |
Character vector of gene identifiers. |
sources |
Character vector of source databases (or |
mode |
Comparison mode: |
A named list with elements: $mode, $sources, $sets
(named list of gene vectors), $intersections, $exclusives,
$genes_used.
## Not run: query_source_comparison(c("TP53", "BRCA1"), mode = "union") ## End(Not run)## Not run: query_source_comparison(c("TP53", "BRCA1"), mode = "union") ## End(Not run)
Query the UniTCM Ingredient Explorer with optional text search and physicochemical property filters.
search_compounds( q = NULL, mw_min = NULL, mw_max = NULL, clogp_min = NULL, clogp_max = NULL, tpsa_min = NULL, tpsa_max = NULL, qed_min = NULL, qed_max = NULL, ring_count_min = NULL, ring_count_max = NULL, lipinski = NULL, is_drug = NULL, sort = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_compounds( q = NULL, mw_min = NULL, mw_max = NULL, clogp_min = NULL, clogp_max = NULL, tpsa_min = NULL, tpsa_max = NULL, qed_min = NULL, qed_max = NULL, ring_count_min = NULL, ring_count_max = NULL, lipinski = NULL, is_drug = NULL, sort = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
q |
Search query (name, SMILES, formula, or CAS number). |
mw_min, mw_max
|
Molecular weight range. |
clogp_min, clogp_max
|
CLogP range. |
tpsa_min, tpsa_max
|
Topological polar surface area range. |
qed_min, qed_max
|
QED score range. |
ring_count_min, ring_count_max
|
Ring count range. |
lipinski |
Lipinski rule filter (character vector, comma-collapsed). |
is_drug |
Approved drug filter (logical or |
sort |
Sort field (e.g. |
page |
Page number (default 1). |
page_size |
Results per page (default 20, max 200). |
all_pages |
If |
A tibble::tibble() of compounds with attribute "total".
## Not run: search_compounds(q = "quercetin") search_compounds(mw_min = 200, mw_max = 500, lipinski = "pass") ## End(Not run)## Not run: search_compounds(q = "quercetin") search_compounds(mw_min = 200, mw_max = 500, lipinski = "pass") ## End(Not run)
Query the TCMomics multi-omics database with optional text search and faceted filters.
search_datasets( q = NULL, tcm = NULL, omics = NULL, source = NULL, organism = NULL, tissue = NULL, disease = NULL, repo = NULL, year_min = NULL, year_max = NULL, sort = NULL, search_mode = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_datasets( q = NULL, tcm = NULL, omics = NULL, source = NULL, organism = NULL, tissue = NULL, disease = NULL, repo = NULL, year_min = NULL, year_max = NULL, sort = NULL, search_mode = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
q |
Optional search query string. |
tcm |
TCM classification filter. |
omics |
Omics type filter. |
source |
Source type filter. |
organism |
Organism filter. |
tissue |
Tissue filter. |
disease |
Disease filter. |
repo |
Repository filter. |
year_min |
Minimum publication year. |
year_max |
Maximum publication year. |
sort |
Sort field: |
search_mode |
Search mode: |
page |
Page number (default 1). |
page_size |
Results per page (default 20). |
all_pages |
If |
A tibble::tibble() of datasets with attribute "total".
## Not run: search_datasets(q = "ginseng", omics = "Transcriptomics") ## End(Not run)## Not run: search_datasets(q = "ginseng", omics = "Transcriptomics") ## End(Not run)
Query the Disease-Formula Atlas with optional text search and ICD-11 disease classification filters. Multi-value parameters accept character vectors and are collapsed to comma-separated strings internally.
search_formulas( q = NULL, level1 = NULL, level2 = NULL, level3 = NULL, level4 = NULL, book_sources = NULL, origin_sources = NULL, dosage_forms = NULL, mapping_confidence = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_formulas( q = NULL, level1 = NULL, level2 = NULL, level3 = NULL, level4 = NULL, book_sources = NULL, origin_sources = NULL, dosage_forms = NULL, mapping_confidence = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
q |
Optional search query string. |
level1, level2, level3, level4
|
ICD-11 disease classification levels. |
book_sources |
Book source filter (character vector). |
origin_sources |
Origin source filter (character vector). |
dosage_forms |
Dosage form filter (character vector). |
mapping_confidence |
Mapping confidence filter (character vector). |
page |
Page number (default 1). |
page_size |
Results per page (default 20, max 100). |
all_pages |
If |
A tibble::tibble() of formulas with attribute "total".
## Not run: search_formulas(q = "insomnia") search_formulas(level1 = "Neoplasms", mapping_confidence = "high") ## End(Not run)## Not run: search_formulas(q = "insomnia") search_formulas(level1 = "Neoplasms", mapping_confidence = "high") ## End(Not run)
Query the UniTCM Herb Explorer with optional text search and faceted filters. Multi-value filter parameters accept character vectors and are collapsed to semicolon-separated strings internally.
search_herbs( q = NULL, therapeutic_en = NULL, therapeutic_cn = NULL, family = NULL, toxicity = NULL, source = NULL, flavors = NULL, properties = NULL, meridians = NULL, medicinal_part = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_herbs( q = NULL, therapeutic_en = NULL, therapeutic_cn = NULL, family = NULL, toxicity = NULL, source = NULL, flavors = NULL, properties = NULL, meridians = NULL, medicinal_part = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
q |
Optional search query string. |
therapeutic_en |
English therapeutic classification filter (character vector). |
therapeutic_cn |
Chinese therapeutic classification filter (character vector). |
family |
Botanical family filter (character vector). |
toxicity |
Toxicity level filter (character vector). |
source |
Data source filter (character vector). |
flavors |
Flavor filter (character vector). |
properties |
Property filter (character vector). |
meridians |
Meridian tropism filter (character vector). |
medicinal_part |
Medicinal part filter (character vector). |
page |
Page number (default 1). |
page_size |
Results per page (default 20, max 200). |
all_pages |
If |
A tibble::tibble() of herbs with attribute "total".
## Not run: search_herbs(q = "ginseng") search_herbs(flavors = c("sweet", "bitter"), page_size = 50) ## End(Not run)## Not run: search_herbs(q = "ginseng") search_herbs(flavors = c("sweet", "bitter"), page_size = 50) ## End(Not run)
Query the Terms Molecular Mechanisms database with optional filters.
search_mechanisms( search = NULL, category = NULL, omics_type = NULL, evidence_level = NULL, confidence_level = NULL, study_type = NULL, species = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_mechanisms( search = NULL, category = NULL, omics_type = NULL, evidence_level = NULL, confidence_level = NULL, study_type = NULL, species = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
search |
Optional text search query. |
category |
Category filter. |
omics_type |
Omics type filter. |
evidence_level |
Evidence level filter. |
confidence_level |
Confidence level filter. |
study_type |
Study type filter. |
species |
Species filter. |
page |
Page number (default 1). |
page_size |
Results per page (default 20). |
all_pages |
If |
A tibble::tibble() of mechanism terms with attribute "total".
## Not run: search_mechanisms(search = "Qi deficiency") ## End(Not run)## Not run: search_mechanisms(search = "Qi deficiency") ## End(Not run)
Search NetVis nodes
search_netvis(q, type = "all", limit = 20L)search_netvis(q, type = "all", limit = 20L)
q |
Search query. |
type |
Node type filter: |
limit |
Maximum results (default 20). |
A tibble::tibble() with columns: id, type, label,
label_cn, degree.
## Not run: search_netvis("ginseng", type = "herb") ## End(Not run)## Not run: search_netvis("ginseng", type = "herb") ## End(Not run)
Full-text search across TCM ontology entities.
search_ontology(q, limit = 20L, level = NULL, category = NULL)search_ontology(q, limit = 20L, level = NULL, category = NULL)
q |
Search query (required). |
limit |
Maximum results to return (default 20). |
level |
Filter by ontology level (integer, 1–4). |
category |
Filter by top-level category. |
A tibble::tibble() with columns: tcm_id, name, name_cn,
level, path, match_field, highlight.
## Not run: search_ontology("Qi stagnation") ## End(Not run)## Not run: search_ontology("Qi stagnation") ## End(Not run)
Find TCM entities mapped to an external database identifier.
search_ontology_mapping(database, external_id)search_ontology_mapping(database, external_id)
database |
External database name. Must be one of: |
external_id |
The external identifier to look up. |
A tibble::tibble() of matched TCM entities.
## Not run: search_ontology_mapping("MeSH", "D008516") ## End(Not run)## Not run: search_ontology_mapping("MeSH", "D008516") ## End(Not run)
Query the UniTCM Target2NP database of natural-product to protein-target interactions, combining records from experimental sources such as BindingDB, HERB2, NPASS, BATMAN, and others.
search_target2np( search = NULL, search_field = c("all", "gene_symbol", "compound_name", "uniprot_id", "inchikey", "pubchem_cid", "chembl_id"), search_mode = c("exact", "fuzzy"), source_db = NULL, evidence_level = NULL, evidence_label = NULL, target_organism = NULL, interaction_type = NULL, activity_type = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_target2np( search = NULL, search_field = c("all", "gene_symbol", "compound_name", "uniprot_id", "inchikey", "pubchem_cid", "chembl_id"), search_mode = c("exact", "fuzzy"), source_db = NULL, evidence_level = NULL, evidence_label = NULL, target_organism = NULL, interaction_type = NULL, activity_type = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
search |
Free-text search query. |
search_field |
Field to restrict the search to. One of |
search_mode |
|
source_db |
Filter by source database (e.g. |
evidence_level |
Filter by evidence level (integer 1-4 as string). |
evidence_label |
Filter by evidence label. |
target_organism |
Filter by target organism (e.g. |
interaction_type |
Filter by interaction type. |
activity_type |
Filter by activity type (e.g. |
page |
Page number (default 1). |
page_size |
Results per page (default 20, max 100). |
all_pages |
If |
A tibble::tibble() of interaction records with attribute
"total".
## Not run: search_target2np(search = "quercetin") search_target2np(search = "TP53", search_field = "gene_symbol", source_db = "BindingDB") ## End(Not run)## Not run: search_target2np(search = "quercetin") search_target2np(search = "TP53", search_field = "gene_symbol", source_db = "BindingDB") ## End(Not run)
Query DrugCLIP deep-learning predictions, with optional confidence filtering by predicted score.
search_target2np_drugclip( search = NULL, search_field = c("all", "gene_symbol", "compound_name", "inchikey"), search_mode = c("exact", "fuzzy"), min_score = NULL, confidence = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_target2np_drugclip( search = NULL, search_field = c("all", "gene_symbol", "compound_name", "inchikey"), search_mode = c("exact", "fuzzy"), min_score = NULL, confidence = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
search |
Free-text search. |
search_field |
One of |
search_mode |
|
min_score |
Minimum DrugCLIP score (0-1). |
confidence |
One of |
page, page_size
|
Pagination. |
all_pages |
If |
A tibble::tibble() of DrugCLIP predictions with attribute
"total".
## Not run: search_target2np_drugclip(search = "quercetin", confidence = "high") ## End(Not run)## Not run: search_target2np_drugclip(search = "quercetin", confidence = "high") ## End(Not run)
Query SEA-style predictions derived from ChEMBL similarity scoring, with optional adjusted p-value filtering.
search_target2np_sea( search = NULL, search_field = c("all", "gene_symbol", "compound_name", "uniprot_id", "inchikey"), search_mode = c("exact", "fuzzy"), max_pvalue = NULL, confidence = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_target2np_sea( search = NULL, search_field = c("all", "gene_symbol", "compound_name", "uniprot_id", "inchikey"), search_mode = c("exact", "fuzzy"), max_pvalue = NULL, confidence = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
search |
Free-text search. |
search_field |
One of |
search_mode |
|
max_pvalue |
Maximum adjusted p-value. |
confidence |
One of |
page, page_size
|
Pagination. |
all_pages |
If |
A tibble::tibble() of SEA predictions with attribute "total".
## Not run: search_target2np_sea(search = "quercetin", confidence = "high") ## End(Not run)## Not run: search_target2np_sea(search = "quercetin", confidence = "high") ## End(Not run)
Query the TCM Bilingual Corpus with optional text search and filters.
search_terms( q = NULL, sources = NULL, category = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_terms( q = NULL, sources = NULL, category = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
q |
Optional search query string. |
sources |
Data source filter (character vector, comma-collapsed). |
category |
Category filter (character vector, comma-collapsed). |
page |
Page number (default 1). |
page_size |
Results per page (default 20, max 100). |
all_pages |
If |
A tibble::tibble() of terms with attribute "total".
## Not run: search_terms(q = "ginseng") ## End(Not run)## Not run: search_terms(q = "ginseng") ## End(Not run)
Query the TCM Transcriptome Hub. This endpoint uses Style-B pagination
(count/results instead of total/items).
search_transcriptomes( search = NULL, tcm_classification = NULL, organism = NULL, model_type = NULL, experiment_type = NULL, disease_classification = NULL, cell_line = NULL, comparison_type = NULL, confidence = NULL, sequence_type = NULL, page = 1L, page_size = 20L, all_pages = FALSE )search_transcriptomes( search = NULL, tcm_classification = NULL, organism = NULL, model_type = NULL, experiment_type = NULL, disease_classification = NULL, cell_line = NULL, comparison_type = NULL, confidence = NULL, sequence_type = NULL, page = 1L, page_size = 20L, all_pages = FALSE )
search |
Optional text search query. |
tcm_classification |
TCM classification filter. |
organism |
Organism filter. |
model_type |
Model type filter. |
experiment_type |
Experiment type filter. |
disease_classification |
Disease classification filter. |
cell_line |
Cell line filter. |
comparison_type |
Comparison type filter. |
confidence |
Confidence filter. |
sequence_type |
Sequence type filter. |
page |
Page number (default 1). |
page_size |
Results per page (default 20). |
all_pages |
If |
A tibble::tibble() of datasets with attribute "total".
## Not run: search_transcriptomes(search = "ginseng") ## End(Not run)## Not run: search_transcriptomes(search = "ginseng") ## End(Not run)
Stores the API key in session memory. Optionally also stores it in the system keyring (requires the keyring package).
set_api_key(api_key, keyring = FALSE)set_api_key(api_key, keyring = FALSE)
api_key |
A character string. The API key (starts with |
keyring |
Logical. If |
Invisible NULL.
## Not run: set_api_key("unitcm_your_key_here") ## End(Not run)## Not run: set_api_key("unitcm_your_key_here") ## End(Not run)
Set the UniTCM API base URL
set_base_url(url)set_base_url(url)
url |
A character string. The base URL for the UniTCM API,
e.g. |
Invisible previous URL value.
## Not run: set_base_url("https://unitcm.qfxulab.com/api/v1") ## End(Not run)## Not run: set_base_url("https://unitcm.qfxulab.com/api/v1") ## End(Not run)
Stores the token in session memory. Optionally also stores it in the system keyring (requires the keyring package).
set_unitcm_token(token, keyring = FALSE)set_unitcm_token(token, keyring = FALSE)
token |
A character string. The bearer token. |
keyring |
Logical. If |
Invisible NULL.
## Not run: set_unitcm_token("my-secret-token") ## End(Not run)## Not run: set_unitcm_token("my-secret-token") ## End(Not run)
Combine experimental records, DrugCLIP predictions, and SEA predictions for one query, returning source counts, target/compound overlap sets, confidence distributions, cross-validated compound-target pairs, and an interpretive suggestion string.
target2np_multi_source_summary( search = NULL, sources = c("experimental", "drugclip", "sea"), search_field = c("all", "gene_symbol", "compound_name", "uniprot_id", "inchikey", "pubchem_cid", "chembl_id"), search_mode = c("exact", "fuzzy") )target2np_multi_source_summary( search = NULL, sources = c("experimental", "drugclip", "sea"), search_field = c("all", "gene_symbol", "compound_name", "uniprot_id", "inchikey", "pubchem_cid", "chembl_id"), search_mode = c("exact", "fuzzy") )
search |
Free-text search query. |
sources |
Character vector of sources to query. Subset of
|
search_field |
One of |
search_mode |
|
A named list with fields source_counts, target_overlap,
compound_overlap, confidence_distribution, cross_validated,
and suggestion_text.
## Not run: summary <- target2np_multi_source_summary( search = "TP53", search_field = "gene_symbol" ) summary$source_counts summary$suggestion_text ## End(Not run)## Not run: summary <- target2np_multi_source_summary( search = "TP53", search_field = "gene_symbol" ) summary$source_counts summary$suggestion_text ## End(Not run)
Clears any memoized API results. Currently a no-op placeholder for future caching support.
unitcm_cache_clear()unitcm_cache_clear()
Invisible NULL.