Skip to content

Releases

klct v0.2.2

Choose a tag to compare

@ricompute ricompute released this 30 Mar 22:34
  • Y-axis labels with units: plot_groups() facet strips and
    plot_groups_2x2() y-axis labels now display the measure name with its
    unit (e.g., "Ct.Th (mm)", "Ct.vBMD (mg HA/cm³)"). In plot_groups(),
    the unit wraps to a second line below the measure name so that facet strips
    stay compact even with long units. An internal measure_units lookup in
    R/labels.R maps every NeoScan measure column to its unit string; unknown
    measures fall back to the raw column name.

klct v0.2.1

Choose a tag to compare

@ricompute ricompute released this 30 Mar 21:53

Plot improvements

  • Significance brackets: plot_groups() now uses
    ggsignif::geom_signif() to draw proper comparison brackets between the
    two treatment groups, replacing the previous geom_text() approach that
    placed asterisks above individual group bars. Brackets appear only in
    facets with a significant result (P < 0.05). Pre-computed p-values
    (Welch's t-test or Wilcoxon) are passed through, keeping the test logic
    consistent with compare_groups().

  • Data-driven y-axis limits: Removed expand_limits(y = 0) from both
    plot_groups() and plot_groups_2x2(). Axis limits are now determined
    automatically by ggplot based on the data range, which substantially
    improves readability for measures whose values are far from zero (e.g.,
    Ct.vBMD ~1074--1432, Ct.Ar/Tt.Ar ~97--100%).

  • Facet wrapping for many measures: plot_groups() now caps facet
    columns at 5 per row (via ncol = min(n_measures, 5)) instead of forcing
    all facets into a single row. This prevents facet labels from being clipped
    when plotting the 9 default cortical measures. Trabecular plots (4 default
    measures) are unaffected.

Interactive data tables

  • print_data(): New exported function that wraps DT::datatable() to
    display raw bone microCT data as interactive, sortable, searchable tables
    in the Data tabs of the R Markdown templates. Each sex is displayed as a
    separate table. Metadata columns (Animal ID, Site) are dropped and rows
    are ordered by treatment/genotype group.

Template changes

  • Version stamp: All four R Markdown templates now include a statement in
    the Session Info section linking to the specific version of klct used to
    generate the report, with links to the pkgdown site and the corresponding
    GitHub release tag.

Dependencies

  • Added ggsignif to Imports (for geom_signif() comparison brackets in
    plot_groups()).

klct v0.2.0

Choose a tag to compare

@ricompute ricompute released this 19 Mar 21:34

Statistical method improvements

  • Welch's t-test by default: All parametric pairwise comparisons now
    always use Welch's t-test (unequal variances assumed). The preliminary
    F-test for equal variances (var.test()) has been removed, as it inflates
    Type I error rates. This affects compare_groups(), compare_groups_2x2(),
    and plot_groups().

  • Type III sums of squares: compare_groups_2x2() now uses
    lm() + car::Anova(type = "III") with sum-to-zero contrasts instead of
    stats::aov() (which uses Type I sequential SS). This gives correct tests
    for main effects and interactions with unbalanced designs.

  • Benjamini--Hochberg adjusted p-values: A P.adj column is now
    included in all results tables. In compare_groups(), pairwise p-values
    are BH-adjusted per sex across all measures at a site. In
    compare_groups_2x2(), omnibus p-values are BH-adjusted per factor across
    measures, and pairwise p-values are BH-adjusted per sex across measures.
    Significance stars (Sig) and red-color highlighting in the R Markdown
    templates continue to be based on the raw (unadjusted) p-value, as the
    report is intended for exploratory screening.

New output columns

  • Difference column: A Diff column shows the raw difference (group 2
    minus group 1). For parametric results this is the difference in means; for
    nonparametric results, the Hodges--Lehmann pseudomedian of pairwise
    differences (from wilcox.test(conf.int = TRUE)).

  • 95% confidence intervals: CI.Low and CI.High columns report the
    95% CI bounds for the difference. For parametric comparisons these come from
    Welch's t-test. For nonparametric comparisons these come from the Wilcoxon
    rank-sum test with conf.int = TRUE.

  • Effect size reporting: A Pct.Change column shows the percent change
    of the second group relative to the first. For parametric results this is
    based on group means; for nonparametric results, on group medians.

  • SD column: Parametric results now include an SD column alongside the
    existing SEM column.

  • Q1 and Q3 columns: Nonparametric results now report Q1 (25th
    percentile) and Q3 (75th percentile) instead of IQR, giving a clearer
    picture of the distribution's location and spread.

Dependencies

  • Added car to Imports (for car::Anova() with Type III sums of squares).

Template changes

  • The omnibus test label in print_results_2x2() now reads "Type III ANOVA"
    (parametric) and the pairwise label reads "Welch's t-test" to reflect the
    updated methods.
  • R Markdown templates no longer require all three data files (spine, metaphysis,
    diaphysis) to be present. When a data file is missing, the corresponding
    section is omitted from the report entirely rather than causing the report to
    error. Only the mouse table is required.
  • The knit: function reference in standard (non-Mayo) templates has been
    corrected from microctr::knit_with_colored_text to
    klct::knit_with_colored_text.

klct v0.1.0

Choose a tag to compare

@ricompute ricompute released this 18 Mar 21:14
  • This is the first functional release of klct, containing the ability to
    analyze NeoScan microCT data comparing two treatment groups.
  • Sites analyzed include femoral metaphysis (trabecular and cortical), femoral
    diaphysis (cortical), and lumbar vertebra (trabecular).
  • Supports both parametric and nonparametric statistical tests via the test
    parameter ("parametric" or "nonparametric"):
    • Two-treatment comparisons (compare_groups()): Student's t-test or
      Wilcoxon rank-sum test.
    • Two-way Treatment × Sex comparisons (compare_groups_2x2()): two-way
      ANOVA or Aligned Rank Transform via ARTool::art().
  • Dynamic measure detection: detect_trabecular_measures() matches ^Tb.
    columns; detect_cortical_measures() captures all other numeric non-metadata
    columns. A shared internal helper .resolve_measures() centralizes measure
    resolution across all analysis and plotting functions.
  • The measures parameter (available in compare_groups(),
    compare_groups_2x2(), and plot_groups()) accepts NULL for sensible
    defaults, "all" for all detected columns, or a custom character vector.
    default_trabecular_measures and default_cortical_measures are exported.
  • Omnibus tables in two-way results are trimmed to Factor, P, and Sig
    columns only.
  • Pairwise comparisons are merged directly into the Group Summaries table
    (blank for the first group, p-value and significance stars for the second
    group within each sex), matching the compare_groups() convention. The table
    heading reflects the test used (t-test or Wilcoxon).
  • Includes four R Markdown templates:
    • "Compare Two Treatments" for analyzing each sex separately.
    • "Compare Two Treatments (Mayo)" — Mayo-themed version using
      mayodown::mayohtml.
    • "Compare Two Treatments and Two Sexes" for a full two-way design.
    • "Compare Two Treatments and Two Sexes (Mayo)" — Mayo-themed version
      using mayodown::mayohtml.
  • Template features:
    • Parametric and nonparametric results are displayed as separate tabs.
    • By-sex plot tabs are consolidated into a single tab (differing only in
      significance annotations).
    • Combined Sexes Plots tabs are included in all sections.
    • All templates accept a test parameter in the YAML header.
  • Mayo-themed templates use the mayodown package for consistent branding,
    including the Mayo logo, color scheme, and copyright footer.
  • The color-text.lua Pandoc filter is provided by mayodown, enabling
    colored significance annotations in all template formats.