Package 'PhysioAnnotationHub'

Title: Anatomical and Clinical Knowledge Graph for Physiological Data
Description: Centralized annotation hub providing anatomical ontology, muscle/bone metadata, nerve innervation, clinical codes (ICD-10, ICF), and knowledge graph queries for the physio-ecosystem.
Authors: Yusuke Matsui [aut, cre]
Maintainer: Yusuke Matsui <[email protected]>
License: MIT + file LICENSE
Version: 0.2.1
Built: 2026-10-03 13:41:30 UTC
Source: https://github.com/x-biosignal/PhysioAnnotationHub

Help Index


Get bone annotations

Description

Get bone annotations

Usage

getBoneAnnotation(bones = NULL, hub = NULL, fuzzy = TRUE)

Arguments

bones

Character vector of bone names (NULL for all)

hub

AnnotationHub object

fuzzy

Logical; use fuzzy matching (default TRUE)

Value

data.frame of bone annotations

Examples

getBoneAnnotation("Occipital")

Get clinical codes for muscles

Description

Get clinical codes for muscles

Usage

getClinicalCodes(muscles, system = c("icd10", "icf"), hub = NULL)

Arguments

muscles

Character vector of muscle names

system

Character; "icd10" or "icf" (default "icd10")

hub

AnnotationHub object

Value

data.frame of matching clinical codes

Examples

getClinicalCodes("Rectus abdominis", system = "icd10")

Retrieve a published ICF Core Set

Description

Returns the categories of a published WHO ICF Core Set for a health condition. Currently the Brief ICF Core Set for Stroke (Geyh 2004) is bundled; the data are the officially published category lists, not derived.

Usage

getCoreSet(condition, level = c("brief", "comprehensive"), hub = NULL)

Arguments

condition

Condition name (e.g. "Stroke"); case-insensitive.

level

"brief" or "comprehensive" (default "brief").

hub

Optional PhysioAnnotationHub.

Value

A data frame of ICF categories (icf_code, category_title, component, ...) for the requested Core Set.

References

Geyh et al. 2004, ICF Core Sets for Stroke; ICF Research Branch.

See Also

[icfCategories()], [tagICF()]

Examples

getCoreSet("Stroke")

Get muscle annotations

Description

Get muscle annotations

Usage

getMuscleAnnotation(muscles = NULL, hub = NULL, fuzzy = TRUE)

Arguments

muscles

Character vector of muscle names (NULL for all)

hub

AnnotationHub object

fuzzy

Logical; use fuzzy matching (default TRUE)

Value

data.frame of muscle annotations

Examples

getMuscleAnnotation("Trapezius")
nrow(getMuscleAnnotation())   # the whole muscle table

Get nerve annotations

Description

Get nerve annotations

Usage

getNerveAnnotation(nerves = NULL, hub = NULL)

Arguments

nerves

Character vector of nerve names (NULL for all)

hub

AnnotationHub object

Value

data.frame of nerve annotations

Examples

getNerveAnnotation("Accessory")

Look up ICF category titles

Description

Resolves ICF category codes to their titles (across the hub's Core-Set, metric-link, and clinical ICF tables).

Usage

icfCategories(codes, hub = NULL)

Arguments

codes

A character vector of ICF codes (e.g. c("b730", "d450")).

hub

Optional PhysioAnnotationHub.

Value

A data frame with icf_code and title (NA title for an unknown code).

See Also

[getCoreSet()], [tagICF()]

Examples

icfCategories(c("b730", "d450"))

Functional enrichment analysis for a set of muscles

Description

Tests whether a set of muscles is enriched for specific annotations (actions, innervation, body regions) compared to the full set.

Usage

kgEnrichment(
  muscles,
  annotation_type = c("action", "nerve", "body_region", "spinal_level"),
  hub = NULL
)

Arguments

muscles

Character vector of muscle names (query set)

annotation_type

Character; "action", "nerve", "body_region", "spinal_level"

hub

AnnotationHub object

Value

data.frame with term, count, expected, fold_enrichment, p_value

Examples

kgEnrichment(
  c("Trapezius", "Latissimus Dorsi", "Serratus Posterior Superior"),
  annotation_type = "body_region"
)

Get KG neighbors of an entity

Description

Get KG neighbors of an entity

Usage

kgNeighbors(entity, depth = 1, hub = NULL)

Arguments

entity

Character; entity name

depth

Integer; traversal depth (default 1)

hub

AnnotationHub object

Value

data.frame of all triples within depth hops

Examples

head(kgNeighbors("Trapezius"))

Find shortest path between two entities in the KG

Description

Find shortest path between two entities in the KG

Usage

kgShortestPath(from, to, hub = NULL, max_depth = 5)

Arguments

from

Character; source entity name

to

Character; target entity name

hub

AnnotationHub object

max_depth

Integer; maximum search depth (default 5)

Value

List with path (entities), predicates, and depth

Examples

kgShortestPath("Trapezius", "External Occipital Protuberance")

Link a clinical instrument to its ICF categories

Description

Like [tagICF()] but returns a data frame with the ICF code and its title, suitable for annotating a clinical outcome measure.

Usage

linkInstrumentToICF(instrument_id, hub = NULL)

Arguments

instrument_id

A clinical instrument identifier (e.g. "berg", "fma_ue").

hub

Optional PhysioAnnotationHub.

Value

A data frame with instrument_id, icf_code, icf_title (zero rows, with a warning, if unmapped).

See Also

[tagICF()]

Examples

linkInstrumentToICF("berg")

Load the PhysioAnnotationHub

Description

Loads all annotation data into a cached environment for fast repeated queries.

Usage

loadAnnotationHub(reload = FALSE)

Arguments

reload

Logical; force reload even if cached (default FALSE)

Value

An AnnotationHub object (list) with muscle, bone, nerve, kg, clinical data

Examples

hub <- loadAnnotationHub()
hub

Print method for PhysioAnnotationHub

Description

Print method for PhysioAnnotationHub

Usage

## S3 method for class 'PhysioAnnotationHub'
print(x, ...)

Arguments

x

A PhysioAnnotationHub object

...

Additional arguments (ignored)

Value

Invisibly returns x


Query the Knowledge Graph by triple pattern

Description

Query the Knowledge Graph by triple pattern

Usage

queryKG(
  subject = NULL,
  predicate = NULL,
  object = NULL,
  hub = NULL,
  exact = FALSE
)

Arguments

subject

Character or NULL; entity name pattern (grep)

predicate

Character or NULL; relation type (exact or grep)

object

Character or NULL; target entity pattern (grep)

hub

AnnotationHub object (loaded if NULL)

exact

Logical; use exact matching instead of grep (default FALSE)

Value

data.frame of matching triples

Examples

# All triples with Trapezius as the subject:
head(queryKG(subject = "Trapezius"))

Tag a metric or instrument with ICF categories

Description

Returns the WHO ICF category codes linked to a physiological metric or clinical instrument, using the packaged metric-to-ICF map (built with the Cieza 2005 ICF linking rules). Matching is case-insensitive.

Usage

tagICF(metric, hub = NULL)

Arguments

metric

A metric / instrument identifier (e.g. "gait_speed", "FMA_UE", "HRV").

hub

Optional PhysioAnnotationHub (loaded on demand otherwise).

Value

A character vector of ICF codes (empty, with a warning, if unmapped).

References

WHO ICF; Cieza et al. 2005 (ICF linking rules).

See Also

[linkInstrumentToICF()], [getCoreSet()], [icfCategories()]

Examples

tagICF("gait_speed")
tagICF("FMA_UE")