## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----basic, eval = FALSE------------------------------------------------------
# library(MyoScore)
# 
# # From a CSV file (genes as rows, samples as columns)
# scores <- myoscore_score("path/to/raw_counts.csv")
# 
# # From a matrix in R
# scores <- myoscore_score(count_matrix)
# 
# # For tab-separated files
# scores <- myoscore_score("counts.tsv", sep = "\t")

## ----genes--------------------------------------------------------------------
library(MyoScore)
data(myoscore_genes)
head(myoscore_genes)
table(myoscore_genes$dimension)

## ----preprocess, eval = FALSE-------------------------------------------------
# # Just normalize without scoring
# log2cpm <- myoscore_preprocess(count_matrix)

## ----single_dim, eval = FALSE-------------------------------------------------
# log2cpm <- myoscore_preprocess(count_matrix)
# youth <- myoscore_score_dimension(log2cpm, dimension = "Youth")

## ----radar, eval = FALSE------------------------------------------------------
# # Requires: install.packages("fmsb")
# 
# # Overall mean radar
# myoscore_plot_radar(scores)
# 
# # Grouped by condition
# myoscore_plot_radar(scores, groups = metadata$condition)

## ----boxplot, eval = FALSE----------------------------------------------------
# # Requires: install.packages("ggplot2")
# 
# # Compare MyoScore across groups
# myoscore_plot_boxplot(scores, groups = metadata$condition)
# 
# # All dimensions
# myoscore_plot_boxplot(scores, groups = metadata$condition, which = "all")

## ----colors-------------------------------------------------------------------
myoscore_colors("dimensions")
myoscore_colors("spectrum")

