| Title: | Transcriptomic Scoring for Human Skeletal Muscle Health |
|---|---|
| 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>. |
| Authors: | Huahua Zhong [aut, cre] (ORCID: <https://orcid.org/0000-0002-7852-3982>) |
| Maintainer: | Huahua Zhong <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.1 |
| Built: | 2026-06-02 07:26:45 UTC |
| Source: | https://github.com/hirriririir/myoscore |
Get MyoScore color palette
myoscore_colors(type = c("dimensions", "spectrum", "all"))myoscore_colors(type = c("dimensions", "spectrum", "all"))
type |
One of |
Named character vector of hex color codes.
myoscore_colors("dimensions") myoscore_colors("spectrum")myoscore_colors("dimensions") myoscore_colors("spectrum")
Get MyoScore dimension names
myoscore_dimensions()myoscore_dimensions()
Character vector of the five dimension names.
myoscore_dimensions()myoscore_dimensions()
A data frame containing 591 gene-dimension entries (417 unique genes) used in MyoScore calculation, filtered to genes detectable in bulk RNA-seq datasets.
myoscore_genesmyoscore_genes
A data frame with 591 rows and 4 columns:
Gene symbol (HGNC).
Gene weight derived from TWAS Z-scores (|mean_Z| / n_phenotypes).
Direction of effect: +1 means high expression indicates health; -1 means high expression indicates disease.
One of five dimensions: Strength, Mass, LeanMuscle, Youth, Resilience.
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.
Myopathy Spectrum Project, GWAS-TWAS integration pipeline.
data(myoscore_genes) table(myoscore_genes$dimension)data(myoscore_genes) table(myoscore_genes$dimension)
Create grouped boxplots comparing MyoScore or individual dimension scores across conditions. Uses base R graphics by default, or ggplot2 if available.
myoscore_plot_boxplot( scores, groups, which = "MyoScore", colors = NULL, use_ggplot = TRUE, title = NULL, ... )myoscore_plot_boxplot( scores, groups, which = "MyoScore", colors = NULL, use_ggplot = TRUE, title = NULL, ... )
scores |
A data.frame from |
groups |
A factor or character vector of group labels (one per sample). |
which |
Which score to plot. One of |
colors |
Optional named or positional color vector. |
use_ggplot |
Logical. Use ggplot2 if available. Default |
title |
Optional main title. |
... |
Additional arguments passed to |
If use_ggplot = TRUE and ggplot2 is available, returns a
ggplot object. Otherwise, invisible NULL.
# 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)# 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)
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.
myoscore_plot_radar( scores, groups = NULL, colors = NULL, facet = TRUE, title = NULL, show_values = TRUE, ... )myoscore_plot_radar( scores, groups = NULL, colors = NULL, facet = TRUE, title = NULL, show_values = TRUE, ... )
scores |
A data.frame from |
groups |
Optional. A factor or character vector assigning each row
of |
colors |
Optional. Character vector of colors (one per group).
Default uses |
facet |
Logical. If |
title |
Optional main title. |
show_values |
Logical. Show score values at vertices. Default |
... |
Additional arguments passed to |
Requires the fmsb package (in Suggests).
Invisible NULL. Called for its side effect (plot).
# 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)# 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)
Normalize raw RNA-seq count data using CPM (Counts Per Million) followed by log2 transformation. This is the standard preprocessing step before MyoScore calculation.
myoscore_preprocess(raw_counts, verbose = TRUE)myoscore_preprocess(raw_counts, verbose = TRUE)
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 |
The transformation pipeline is:
CPM: counts / total_counts * 1e6
log2(CPM + 1)
A numeric matrix of log2(CPM+1) values with the same dimensions and names as the input.
# 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)# 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)
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.
myoscore_score( input, gene_weights = NULL, sep = ",", min_coverage = 0.1, verbose = TRUE )myoscore_score( input, gene_weights = NULL, sep = ",", min_coverage = 0.1, verbose = TRUE )
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
|
sep |
Separator for reading CSV files. Default |
min_coverage |
Minimum fraction (0-1) of genes required per dimension.
Dimensions below this threshold return |
verbose |
Logical. Print progress messages. Default |
Raw counts are normalized to log2(CPM+1).
For each dimension, available genes are z-score standardized (gene-wise across all input samples).
Z-scores are multiplied by gene direction and weight, then averaged (weighted mean).
Raw dimension scores are min-max normalized to 0-100.
Composite MyoScore is a weighted sum of the five dimensions.
Higher scores indicate healthier muscle. The composite MyoScore ranges from 0 (severe myopathy) to 100 (optimal muscle health).
Requires >= 20 samples for meaningful min-max normalization.
Single-sample scoring is not recommended (use a reference cohort).
Typical bulk RNA-seq datasets contain ~417 of the 1,116 scoring genes.
A data.frame with samples as rows and columns:
Strength_score, Mass_score, LeanMuscle_score,
Youth_score, Resilience_score, MyoScore.
# 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)# 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
myoscore_score_dimension( log2cpm, gene_weights = NULL, dimension, min_coverage = 0.1, verbose = TRUE )myoscore_score_dimension( log2cpm, gene_weights = NULL, dimension, min_coverage = 0.1, verbose = TRUE )
log2cpm |
Numeric matrix of log2(CPM+1) values (genes x samples). |
gene_weights |
Data.frame with columns |
dimension |
Character. One of the five MyoScore dimensions. |
min_coverage |
Minimum gene coverage fraction. Default |
verbose |
Logical. Print progress. Default |
Numeric vector of dimension scores (0-100), one per sample.
Get MyoScore dimension weights
myoscore_weights()myoscore_weights()
Named numeric vector of dimension weights (sum to 1.0).
myoscore_weights()myoscore_weights()
Data-driven weights for the five MyoScore dimensions, derived from GWAS-TWAS integration of 28 muscle-related phenotypes.
Weights represent the relative contribution of each dimension to overall muscle health, determined by variance explained in the 1,722-sample training cohort.