Title: Transcriptomic Scoring for Human Skeletal Muscle Health
Version: 1.0.1
Description: Calculate MyoScore, a genetically informed muscle health score, from bulk RNA sequencing (RNA-seq) raw count data. MyoScore integrates results from genome-wide association studies (GWAS) and transcriptome-wide association studies (TWAS) across 28 muscle-related phenotypes to quantify muscle health along five dimensions (Strength, Mass, LeanMuscle, Youth, Resilience), each scored from 0 to 100. The package provides preprocessing via counts per million (CPM) normalization, dimension-level and composite scoring, and visualization utilities including radar charts and grouped boxplots. For more information, see https://github.com/Hirriririir/MyoScore.
License: MIT + file LICENSE
URL: https://github.com/Hirriririir/MyoScore
BugReports: https://github.com/Hirriririir/MyoScore/issues
Depends: R (≥ 4.0.0)
Imports: stats, utils, graphics, grDevices
Suggests: ggplot2 (≥ 3.4.0), fmsb, patchwork, testthat (≥ 3.0.0), knitr, rmarkdown
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-03-29 18:27:25 UTC; hua
Author: Huahua Zhong ORCID iD [aut, cre]
Maintainer: Huahua Zhong <huahuazhong@fudan.edu.cn>
Repository: CRAN
Date/Publication: 2026-04-02 20:30:10 UTC

MyoScore Dimension Weights and Constants

Description

Data-driven weights for the five MyoScore dimensions, derived from GWAS-TWAS integration of 28 muscle-related phenotypes.

Details

Weights represent the relative contribution of each dimension to overall muscle health, determined by variance explained in the 1,722-sample training cohort.


Get MyoScore color palette

Description

Get MyoScore color palette

Usage

myoscore_colors(type = c("dimensions", "spectrum", "all"))

Arguments

type

One of "dimensions" (5 dimension colors), "spectrum" (unhealthy-to-healthy gradient), or "all".

Value

Named character vector of hex color codes.

Examples

myoscore_colors("dimensions")
myoscore_colors("spectrum")

Get MyoScore dimension names

Description

Get MyoScore dimension names

Usage

myoscore_dimensions()

Value

Character vector of the five dimension names.

Examples

myoscore_dimensions()

MyoScore Gene Weights

Description

A data frame containing 591 gene-dimension entries (417 unique genes) used in MyoScore calculation, filtered to genes detectable in bulk RNA-seq datasets.

Usage

myoscore_genes

Format

A data frame with 591 rows and 4 columns:

ID

Gene symbol (HGNC).

weight

Gene weight derived from TWAS Z-scores (|mean_Z| / n_phenotypes).

direction_v3

Direction of effect: +1 means high expression indicates health; -1 means high expression indicates disease.

dimension

One of five dimensions: Strength, Mass, LeanMuscle, Youth, Resilience.

Details

Genes were identified through TWAS (Transcriptome-Wide Association Study) using FUSION with GTEx v8 skeletal muscle eQTL weights and 28 GWAS phenotypes covering grip strength, body composition, MRI fat infiltration, telomere length, and myopathy diagnoses.

Source

Myopathy Spectrum Project, GWAS-TWAS integration pipeline.

Examples

data(myoscore_genes)
table(myoscore_genes$dimension)

Boxplot of MyoScore by Groups

Description

Create grouped boxplots comparing MyoScore or individual dimension scores across conditions. Uses base R graphics by default, or ggplot2 if available.

Usage

myoscore_plot_boxplot(
  scores,
  groups,
  which = "MyoScore",
  colors = NULL,
  use_ggplot = TRUE,
  title = NULL,
  ...
)

Arguments

scores

A data.frame from myoscore_score().

groups

A factor or character vector of group labels (one per sample).

which

Which score to plot. One of "MyoScore", "Strength", "Mass", "LeanMuscle", "Youth", "Resilience", or "all" for a multi-panel figure. Default "MyoScore".

colors

Optional named or positional color vector.

use_ggplot

Logical. Use ggplot2 if available. Default TRUE.

title

Optional main title.

...

Additional arguments passed to boxplot() or ggplot2::geom_boxplot().

Value

If use_ggplot = TRUE and ggplot2 is available, returns a ggplot object. Otherwise, invisible NULL.

Examples

# Create example scores and groups
scores_df <- data.frame(
  Strength_score  = c(rnorm(5, 55, 5), rnorm(5, 40, 5)),
  Mass_score      = c(rnorm(5, 50, 5), rnorm(5, 45, 5)),
  LeanMuscle_score = c(rnorm(5, 48, 5), rnorm(5, 38, 5)),
  Youth_score     = c(rnorm(5, 52, 5), rnorm(5, 35, 5)),
  Resilience_score = c(rnorm(5, 50, 5), rnorm(5, 45, 5)),
  MyoScore        = c(rnorm(5, 50, 3), rnorm(5, 40, 3))
)
groups <- rep(c("Healthy", "Disease"), each = 5)

myoscore_plot_boxplot(scores_df, groups = groups)


Radar Chart of MyoScore Dimensions

Description

Plot a radar (spider) chart showing the five MyoScore dimensions. Supports plotting one or more groups (e.g., disease stages) as overlaid or faceted panels.

Usage

myoscore_plot_radar(
  scores,
  groups = NULL,
  colors = NULL,
  facet = TRUE,
  title = NULL,
  show_values = TRUE,
  ...
)

Arguments

scores

A data.frame from myoscore_score(), or a named numeric vector of length 5 (one value per dimension), or a matrix/data.frame where each row is a group and columns are dimension scores.

groups

Optional. A factor or character vector assigning each row of scores to a group. When provided, group means are plotted.

colors

Optional. Character vector of colors (one per group). Default uses myoscore_colors() with type "spectrum".

facet

Logical. If TRUE and multiple groups exist, plot each group in a separate panel. Default TRUE.

title

Optional main title.

show_values

Logical. Show score values at vertices. Default TRUE.

...

Additional arguments passed to fmsb::radarchart().

Details

Requires the fmsb package (in Suggests).

Value

Invisible NULL. Called for its side effect (plot).

Examples

# Radar chart from a named vector of dimension scores
dim_scores <- c(Strength = 55, Mass = 48, LeanMuscle = 42,
                Youth = 60, Resilience = 50)

myoscore_plot_radar(dim_scores)


Preprocess Raw Counts to log2(CPM+1)

Description

Normalize raw RNA-seq count data using CPM (Counts Per Million) followed by log2 transformation. This is the standard preprocessing step before MyoScore calculation.

Usage

myoscore_preprocess(raw_counts, verbose = TRUE)

Arguments

raw_counts

A numeric matrix or data.frame of raw counts with genes as rows and samples as columns. Row names should be gene symbols.

verbose

Logical. Print progress messages. Default TRUE.

Details

The transformation pipeline is:

  1. CPM: counts / total_counts * 1e6

  2. log2(CPM + 1)

Value

A numeric matrix of log2(CPM+1) values with the same dimensions and names as the input.

Examples

# Create example count matrix
counts <- matrix(rpois(500, lambda = 100), nrow = 50, ncol = 10)
rownames(counts) <- paste0("Gene", 1:50)
colnames(counts) <- paste0("Sample", 1:10)

log2cpm <- myoscore_preprocess(counts)

Calculate MyoScore from Raw Count Data

Description

Main entry point for computing MyoScore (Genetic Muscle Health Score). Accepts either a file path or a count matrix, and returns per-sample scores for all five dimensions plus the composite score.

Usage

myoscore_score(
  input,
  gene_weights = NULL,
  sep = ",",
  min_coverage = 0.1,
  verbose = TRUE
)

Arguments

input

Either a file path (character) to a raw count CSV/TSV, or a numeric matrix/data.frame with genes as rows and samples as columns. Gene symbols must be row names.

gene_weights

Optional. A data.frame of gene weights with columns ID, weight, direction_v3, dimension. Default uses the built-in myoscore_genes dataset.

sep

Separator for reading CSV files. Default ",". Use "\t" for tab-separated files.

min_coverage

Minimum fraction (0-1) of genes required per dimension. Dimensions below this threshold return NA. Default 0.1.

verbose

Logical. Print progress messages. Default TRUE.

Details

Scoring Pipeline

  1. Raw counts are normalized to log2(CPM+1).

  2. For each dimension, available genes are z-score standardized (gene-wise across all input samples).

  3. Z-scores are multiplied by gene direction and weight, then averaged (weighted mean).

  4. Raw dimension scores are min-max normalized to 0-100.

  5. Composite MyoScore is a weighted sum of the five dimensions.

Interpretation

Higher scores indicate healthier muscle. The composite MyoScore ranges from 0 (severe myopathy) to 100 (optimal muscle health).

Important Notes

Value

A data.frame with samples as rows and columns: Strength_score, Mass_score, LeanMuscle_score, Youth_score, Resilience_score, MyoScore.

Examples

# Create a small example count matrix (50 genes x 10 samples)
set.seed(42)
genes <- head(MyoScore::myoscore_genes$ID, 50)
counts <- matrix(rpois(50 * 10, lambda = 100), nrow = 50,
                 dimnames = list(genes, paste0("S", 1:10)))

scores <- myoscore_score(counts, verbose = FALSE)
head(scores)


Calculate Score for a Single Dimension

Description

Calculate Score for a Single Dimension

Usage

myoscore_score_dimension(
  log2cpm,
  gene_weights = NULL,
  dimension,
  min_coverage = 0.1,
  verbose = TRUE
)

Arguments

log2cpm

Numeric matrix of log2(CPM+1) values (genes x samples).

gene_weights

Data.frame with columns ID, weight, direction_v3, dimension.

dimension

Character. One of the five MyoScore dimensions.

min_coverage

Minimum gene coverage fraction. Default 0.1.

verbose

Logical. Print progress. Default TRUE.

Value

Numeric vector of dimension scores (0-100), one per sample.


Get MyoScore dimension weights

Description

Get MyoScore dimension weights

Usage

myoscore_weights()

Value

Named numeric vector of dimension weights (sum to 1.0).

Examples

myoscore_weights()