Sex- and site-specific reference data for size-invariant properties using multi-stack HRpQCT.
The 10 matches
- [1] § Materials and methods › Statistical analysis ↔ 01_CODE/src/hrpqct_database/dataclasses_hrpqct.py, lines 409–490 · score 0.95 · trabecular bone volume, cortical porosity, trabecular thickness, trabecular separation, Tb.vBMD, Tot.vBMD
- [2] § Materials and methods › Statistical analysis ↔ 01_CODE/src/hrpqct_database/db_converter.py, lines 98–157 · score 0.94 · Tot.Ar, cortical porosity, trabecular thickness, trabecular separation, Tb.vBMD, trabecular bone volume
- [3] § Materials and methods › Cohort ↔ 03_EVALUATION/01_demographics/frax.R, lines 59–137 · score 0.80 · hip fracture risk, major osteoporotic, demographics, Mann, Whitney, Wilcoxon
- [4] § Results › Descriptive statistics ↔ 03_EVALUATION/03_correlation-matrix/correlation-matrix-database.ipynb, lines 580–668 · score 0.73 · Tb.vBMD, tb da, ct po, Tot.vBMD, tb sp, matrix
- [5] § Results › Descriptive statistics ↔ 03_EVALUATION/03_correlation-matrix/correlation-matrix-database.ipynb, lines 279–396 · score 0.68 · Rel.Ct.Th, tb sp, Tot.vBMD, ct po, Ct.vBMD, FN
- [6] § Results › Descriptive statistics ↔ 01_CODE/src/hrpqct_database/dataclasses_hrpqct.py, lines 409–490 · score 0.67 · trabecular bone volume, trabecular thickness, trabecular separation, Tb.vBMD, tb sp, tb bv
- [7] § Results › Descriptive statistics ↔ 01_CODE/src/hrpqct_database/db_converter.py, lines 1330–1385 · score 0.66 · trabecular thickness, trabecular separation, Tb.vBMD, trabecular bone volume, tb sp, tb bv
- [8] § Results › Radar plots ↔ 01_CODE/src/hrpqct_database/statistics_hrpqct.py, lines 494–528 · score 0.64 · Rel.Ct.Th, tb da, Tot.vBMD, Ct.vBMD, tb bv, app
- [9] § Results › Descriptive statistics ↔ 03_EVALUATION/04_rate-change/descriptive_statistics_paper.ipynb, lines 310–364 · score 0.63 · tb sp, Tot.vBMD, ct po, Ct.vBMD, app, male
- [10] § Results › Radar plots ↔ 03_EVALUATION/03_correlation-matrix/correlation-matrix-database.ipynb, lines 580–668 · score 0.63 · Rel.Ct.Th, tb da, Tot.vBMD, Ct.vBMD, tb bv, radar
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 671 lines · 22 KB · GPL-3.0 · 3 matches
- # %% [markdown]
- # ### HR-pQCT parameters: correlation matrices
- #
- # Author: Simone Poncioni, MSB
- #
- # Date: 31.03.2025
- #
- # Data: HR-pQCT database of the University of Bern, Switzerland
- # %%
- # Create a user library directory if it doesn't exist
- user_lib <- "~/R/library"
- dir.create(user_lib, recursive = TRUE, showWarnings = FALSE)
- # Tell R to use this directory for new packages
- .libPaths(c(user_lib, .libPaths()))
- # Function to safely install and load packages
- install_and_load <- function(pkg) {
- if (!require(pkg, character.only = TRUE, quietly = TRUE)) {
- install.packages(pkg, lib = user_lib)
- library(pkg, character.only = TRUE)
- }
- }
- # Install and load all required packages
- pkgs <- c("Hmisc", "corrplot", "ggplot2", "RColorBrewer",
- "pdftools", "png", "IRdisplay", "magick", "paletteer")
- # Apply the function to each package
- invisible(sapply(pkgs, install_and_load))
- # %%
- # Filtering, correlation, and plotting functions
- # Code ideas from:
- # https://cran.r-project.org/web/packages/corrplot/vignettes/corrplot-intro.html
- # https://www.sthda.com/english/wiki/visualize-correlation-matrix-using-correlogram
- filter_dataframe <- function(df, keeps, drops_c) {
- df_filtered <- df[, grepl(keeps, names(df))]
- df_filtered <- df_filtered[, colSums(is.na(df_filtered)) < nrow(df_filtered)]
- drops_c <- paste(drops_f, drops_specific, sep = "|")
- drops <- grep(drops_c, names(df_filtered), value = TRUE)
- df_filtered <- df_filtered[, !(names(df_filtered) %in% drops)]
- df_filtered <- na.omit(df_filtered)
- return(df_filtered)
- }
- correlation_p_matrix <- function(mat, ...) {
- mat <- as.matrix(mat)
- n <- ncol(mat)
- p.mat <- matrix(NA, n, n)
- diag(p.mat) <- 0
- for (i in 1:(n - 1)) {
- for (j in (i + 1):n) {
- tmp <- cor.test(mat[, i], mat[, j], alternative="two.sided", method="pearson", ...)
- p.mat[i, j] <- p.mat[j, i] <- tmp$p.value
- }
- }
- colnames(p.mat) <- rownames(p.mat) <- colnames(mat)
- return(p.mat)
- }
- # %%
- generate_corrplot <- function(df, filename, plot_title, basepath) {
- df_filtered <- filter_dataframe(df, keeps, drops_c)
- # Split all column names before '[' and take the first part
- colnames(df_filtered) <- sub("\\[.*", "", colnames(df_filtered))
- corrmatrix <- cor(as.matrix(df_filtered))
- p.mat <- correlation_p_matrix(df_filtered)
- # Clean column names by removing "Tibia: " prefix
- cleaned_colnames <- gsub("Tibia: ", "", colnames(corrmatrix))
- colnames(corrmatrix) <- cleaned_colnames
- rownames(corrmatrix) <- cleaned_colnames
- colnames(p.mat) <- cleaned_colnames
- rownames(p.mat) <- cleaned_colnames
- # print p.mat
- print.char.matrix(p.mat, quote = FALSE)
- fname <- file.path(basepath, filename)
- pdf(file = fname, width = 12, height = 12)
- # Reduce bottom margin (first value in mar)
- par(mar = c(0.1, 0.5, 3, 0.5), oma = c(0, 0, 0, 0), bg = "white", xpd=TRUE)
- pal_colors <- c("#BF360C", "#E64A19", "#FF8A65", "#FFCCBC","#FFFFFF","#7FC8C9", "#35A7A7", "#018786")
- col <- colorRampPalette(pal_colors)
- corrplot(corrmatrix, method = "color", col = col(200),
- type = "upper", order = "AOE",
- addCoef.col = "black", # Color of the p-values
- number.font = 1, # Use normal font for p-values
- # Increase text sizes
- tl.col = "black", tl.srt = 45, tl.cex = 1.25,
- cl.cex = 1.25, # Larger color legend text
- number.cex = 1.25, # Larger correlation coefficients
- p.mat = p.mat, sig.level = 0.005, insig = "blank",
- diag = FALSE,
- # Fill more of the plot area
- mar = c(0, 0, 0, 0), # Remove internal margins in corrplot
- # Change color legend position to right side to save vertical space
- cl.pos = "r",
- # Reduce color legend ratio
- cl.ratio = 0.2,
- cl.align = "c" # Center the color legend
- )
- # Larger plot title positioned closer to the top of the plot
- mtext(plot_title, side = 3, line = -5.5, cex = 2.0, font = 2, outer = TRUE)
- dev.off()
- png_path <- sub(".pdf$", ".png", fname)
- image <- image_read(fname)
- image_write(image, path = png_path, format = "png")
- display_png(file = png_path)
- }
- # %%
- # Import dataframe
- # df <- read.csv('/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/00_DB/HR-pQCT_database_2025-01-28.csv', check.names = FALSE)
- df <- read.csv('/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/00_DB/HR-pQCT_database_expanded_2025-06-16_16-18.csv', check.names = FALSE)
- # Remove non-numeric columns
- df_numeric <- df[sapply(df, is.numeric)]
- # %%
- # General settings
- basepath = "/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/03_EVALUATION/03_correlation-matrix"
- drops_f = "Measurement number|side|Time difference Frax & HRpQCT \\[days\\]"
- # %%
- # Tibia: Cortical parameters
- drops_specific = "Radius|Tb."
- keeps = "Tibia|Ct..\\."
- filename = "tibia_cort_correlation_matrix.pdf"
- plot_title = "Tibia: Cortical parameters (p<0.005)"
- generate_corrplot(df, filename, plot_title, basepath)
- # %%
- # Tibia: Trabecular parameters
- drops_specific = "Radius|Ct."
- keeps = "Tibia|Tb..\\."
- filename = "tibia_trab_correlation_matrix.pdf"
- plot_title = "Tibia: Trabecular parameters (p<0.005)"
- generate_corrplot(df, filename, plot_title, basepath)
- # %%
- # Radius: Cortical parameters
- drops_specific = "Tibia|Tb."
- keeps = "Radius|Ct..\\."
- filename = "radius_cort_correlation_matrix.pdf"
- plot_title = "Radius: Cortical parameters (p<0.005)"
- generate_corrplot(df, filename, plot_title, basepath)
- # %%
- # Radius: Trabecular parameters
- drops_specific = "Tibia|Ct."
- keeps = "Radius|Tb..\\."
- filename = "radius_trab_correlation_matrix.pdf"
- plot_title = "Radius: Trabecular parameters (p<0.005)"
- generate_corrplot(df, filename, plot_title, basepath)
- # %%
- # Create correlogram on radar-specific parameters
- # Import dataframe
- df <- read.csv('/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/00_DB/HR-pQCT_database_full_2025-01-28.csv', check.names = FALSE)
- # Remove non-numeric columns
- df_numeric <- df[sapply(df, is.numeric)]
- # Create dataframes with specific columns for Radius and Tibia
- # Define mapping of original column names to standardized names
- radius_cols <- c(
- "Radius: Tt.vBMD [mg HA/cmm]" = "Tot.vBMD",
- "Radius: Ct.vBMD [mg HA/cmm]" = "Ct.vBMD",
- "Radius: Tb.BV/TV [1]" = "Tb.BVTV",
- "Radius: Relative cortical thickness [-]" = "Rel.Ct.Th",
- "Radius: Area ratio (Ct./Tb.) [-]" = "Ct./Tb.Ar",
- "Radius: poncioni_yield_force" = "sigma[y]",
- "Radius: Fmax at failure [N]" = "F[max]",
- "Radius: Ct.Th [mm]" = "Ct.Th",
- "Radius: Ct.Po [1]" = "Ct.Po",
- "Radius: Tb.vBMD [mg HA/cmm]" = "Tb.vBMD",
- "Radius: Tb.N [1/mm]" = "Tb.N",
- "Radius: Tb.Sp [mm]" = "Tb.Sp",
- "Radius: Tb.Th [mm]" = "Tb.Th"
- )
- tibia_cols <- c(
- "Tibia: Tt.vBMD [mg HA/cmm]" = "Tot.vBMD",
- "Tibia: Ct.vBMD [mg HA/cmm]" = "Ct.vBMD",
- "Tibia: Tb.BV/TV [1]" = "Tb.BVTV",
- "Tibia: Relative cortical thickness [-]" = "Rel.Ct.Th",
- "Tibia: Area ratio (Ct./Tb.) [-]" = "Ct./Tb.Ar",
- "Tibia: poncioni_yield_force" = "sigma[y]",
- "Tibia: Fmax at failure [N]" = "F[max]",
- "Tibia: Ct.Th [mm]" = "Ct.Th",
- "Tibia: Ct.Po [1]" = "Ct.Po",
- "Tibia: Tb.vBMD [mg HA/cmm]" = "Tb.vBMD",
- "Tibia: Tb.N [1/mm]" = "Tb.N",
- "Tibia: Tb.Sp [mm]" = "Tb.Sp",
- "Tibia: Tb.Th [mm]" = "Tb.Th"
- )
- # Extract and rename radius data
- radius_df <- df[, names(radius_cols)]
- colnames(radius_df) <- radius_cols
- radius_df$Site <- "Radius"
- # Extract and rename tibia data
- tibia_df <- df[, names(tibia_cols)]
- colnames(tibia_df) <- tibia_cols
- tibia_df$Site <- "Tibia"
- # Combine the dataframes
- combined_df <- rbind(radius_df, tibia_df)
- # Remove rows with NA values
- combined_df <- na.omit(combined_df)
- # General settings
- basepath <- "/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/03_EVALUATION/correlation-matrix/"
- filename <- "hr_pqct_selected_parameters_correlation_matrix.pdf"
- plot_title <- "HR-pQCT key parameters correlation (p<0.005)"
- # Generate correlogram for the combined dataframe
- generate_combined_corrplot <- function(df, filename, plot_title, basepath) {
- # Remove the Site column
- df_filtered <- df[, !names(df) %in% c("Site")]
- # Calculate correlation matrix and p-values
- corrmatrix <- cor(as.matrix(df_filtered))
- p.mat <- correlation_p_matrix(df_filtered)
- # Create the output file
- fname <- file.path(basepath, filename)
- pdf(file = fname, width = 12, height = 12)
- # Set up plot parameters
- par(mar = c(0.1, 0.5, 3, 0.5), oma = c(0, 0, 0, 0), bg = "white", xpd=TRUE)
- pal_colors <- c("#BF360C", "#E64A19", "#FF8A65", "#FFCCBC","#FFFFFF","#7FC8C9", "#35A7A7", "#018786")
- col <- colorRampPalette(pal_colors)
- # Create the correlogram
- corrplot(corrmatrix, method = "color", col = col(200),
- type = "upper", order = "AOE",
- addCoef.col = "black",
- number.font = 1,
- tl.col = "black", tl.srt = 45, tl.cex = 1.25,
- cl.cex = 1.25,
- number.cex = 1.25,
- p.mat = p.mat, sig.level = 0.005, insig = "blank",
- diag = FALSE,
- mar = c(0, 0, 0, 0),
- cl.pos = "r",
- cl.ratio = 0.2,
- cl.align = "c"
- )
- # Add title
- mtext(plot_title, side = 3, line = -5.5, cex = 2.0, font = 2, outer = TRUE)
- dev.off()
- # Create PNG version for display
- png_path <- sub("\\.pdf$", ".png", fname)
- image <- image_read(fname)
- image_write(image, path = png_path, format = "png")
- display_png(file = png_path)
- }
- # Generate the correlogram with just the selected parameters
- generate_combined_corrplot(combined_df, filename, plot_title, basepath)
- # %%
- # Create correlogram on radar-specific parameters
- # Import dataframe
- df <- read.csv('/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/00_DB/HR-pQCT_database_full_2025-01-28.csv', check.names = FALSE)
- # only keep study name Nodaratis
- df <- df[df$Study == "Nodaratis", ]
- # Remove non-numeric columns
- df_numeric <- df[sapply(df, is.numeric)]
- # Create dataframes with specific columns for Radius and Tibia
- # Define mapping of original column names to standardized names
- radius_cols <- c(
- "Radius: Tt.vBMD [mg HA/cmm]" = "Tot.vBMD",
- "Radius: Ct.vBMD [mg HA/cmm]" = "Ct.vBMD",
- "Radius: Tb.BV/TV [1]" = "Tb.BVTV",
- "Radius: Relative cortical thickness [-]" = "Rel.Ct.Th",
- "Radius: Area ratio (Ct./Tb.) [-]" = "Ct./Tb.Ar",
- "Radius: poncioni_yield_force" = "sigma[y]",
- "Radius: Fmax at failure [N]" = "F[max]",
- "Radius: Ct.Th [mm]" = "Ct.Th",
- "Radius: Ct.Po [1]" = "Ct.Po",
- "Radius: Tb.vBMD [mg HA/cmm]" = "Tb.vBMD",
- "Radius: Tb.N [1/mm]" = "Tb.N",
- "Radius: Tb.Sp [mm]" = "Tb.Sp",
- "Radius: Tb.Th [mm]" = "Tb.Th"
- )
- tibia_cols <- c(
- "Tibia: Tt.vBMD [mg HA/cmm]" = "Tot.vBMD",
- "Tibia: Ct.vBMD [mg HA/cmm]" = "Ct.vBMD",
- "Tibia: Tb.BV/TV [1]" = "Tb.BVTV",
- "Tibia: Relative cortical thickness [-]" = "Rel.Ct.Th",
- "Tibia: Area ratio (Ct./Tb.) [-]" = "Ct./Tb.Ar",
- "Tibia: poncioni_yield_force" = "sigma[y]",
- "Tibia: Fmax at failure [N]" = "F[max]",
- "Tibia: Ct.Th [mm]" = "Ct.Th",
- "Tibia: Ct.Po [1]" = "Ct.Po",
- "Tibia: Tb.vBMD [mg HA/cmm]" = "Tb.vBMD",
- "Tibia: Tb.N [1/mm]" = "Tb.N",
- "Tibia: Tb.Sp [mm]" = "Tb.Sp",
- "Tibia: Tb.Th [mm]" = "Tb.Th"
- )
- # Extract and rename radius data
- radius_df <- df[, names(radius_cols)]
- colnames(radius_df) <- radius_cols
- radius_df$Site <- "Radius"
- # Extract and rename tibia data
- tibia_df <- df[, names(tibia_cols)]
- colnames(tibia_df) <- tibia_cols
- tibia_df$Site <- "Tibia"
- # Combine the dataframes
- combined_df <- rbind(radius_df, tibia_df)
- combined_df$Fn.BMD <- df$`Femoral neck BMD (g/cm2)`
- # Remove rows with NA values
- combined_df <- na.omit(combined_df)
- # General settings
- basepath <- "/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/03_EVALUATION/correlation-matrix/"
- filename <- "hr_pqct_selected_parameters_correlation_matrix_nodaratis.pdf"
- plot_title <- "HR-pQCT key parameters correlation (p<0.005)"
- # Generate correlogram for the combined dataframe
- generate_combined_corrplot <- function(df, filename, plot_title, basepath) {
- # Remove the Site column
- df_filtered <- df[, !names(df) %in% c("Site")]
- # Calculate correlation matrix and p-values
- corrmatrix <- cor(as.matrix(df_filtered))
- p.mat <- correlation_p_matrix(df_filtered)
- # Create the output file
- fname <- file.path(basepath, filename)
- pdf(file = fname, width = 12, height = 12)
- # Set up plot parameters
- par(mar = c(0.1, 0.5, 3, 0.5), oma = c(0, 0, 0, 0), bg = "white", xpd=TRUE)
- pal_colors <- c("#BF360C", "#E64A19", "#FF8A65", "#FFCCBC","#FFFFFF","#7FC8C9", "#35A7A7", "#018786")
- col <- colorRampPalette(pal_colors)
- # Create the correlogram
- corrplot(corrmatrix, method = "color", col = col(200),
- type = "upper", order = "AOE",
- addCoef.col = "black",
- number.font = 1,
- tl.col = "black", tl.srt = 45, tl.cex = 1.25,
- cl.cex = 1.25,
- number.cex = 1.25,
- p.mat = p.mat, sig.level = 0.005, insig = "blank",
- diag = FALSE,
- mar = c(0, 0, 0, 0),
- cl.pos = "r",
- cl.ratio = 0.2,
- cl.align = "c"
- )
- # Add title
- mtext(plot_title, side = 3, line = -5.5, cex = 2.0, font = 2, outer = TRUE)
- dev.off()
- # Create PNG version for display
- png_path <- sub("\\.pdf$", ".png", fname)
- image <- image_read(fname)
- image_write(image, path = png_path, format = "png")
- display_png(file = png_path)
- }
- # Generate the correlogram with just the selected parameters
- generate_combined_corrplot(combined_df, filename, plot_title, basepath)
- # %%
- ### ONLY EVALUATE THE TIBIA
- # Create correlogram on radar-specific parameters (tibia only)
- # Import dataframe
- df <- read.csv('/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/00_DB/HR-pQCT_database_full_2025-01-28.csv', check.names = FALSE)
- # only keep study name Nodaratis
- # df <- df[df$Study == "Nodaratis", ]
- # Remove non-numeric columns
- df_numeric <- df[sapply(df, is.numeric)]
- # Create dataframe with specific columns for Tibia
- # Define mapping of original column names to standardized names
- tibia_cols <- c(
- "Tibia: Tt.vBMD [mg HA/cmm]" = "Tot.vBMD",
- "Tibia: Ct.vBMD [mg HA/cmm]" = "Ct.vBMD",
- "Tibia: Tb.BV/TV [1]" = "Tb.BVTV",
- "Tibia: Relative cortical thickness [-]" = "Rel.Ct.Th",
- "Tibia: Area ratio (Ct./Tb.) [-]" = "Ct./Tb.Ar",
- "Tibia: poncioni_yield_force" = "sigma[y]",
- "Tibia: Fmax at failure [N]" = "F[max]",
- "Tibia: Ct.Th [mm]" = "Ct.Th",
- "Tibia: Ct.Po [1]" = "Ct.Po",
- "Tibia: Tb.vBMD [mg HA/cmm]" = "Tb.vBMD",
- "Tibia: Tb.N [1/mm]" = "Tb.N",
- "Tibia: Tb.Sp [mm]" = "Tb.Sp",
- "Tibia: Tb.Th [mm]" = "Tb.Th"
- )
- # Extract and rename tibia data
- tibia_df <- df[, names(tibia_cols)]
- colnames(tibia_df) <- tibia_cols
- # Add femoral neck BMD
- tibia_df$Fn.BMD <- df$`Femoral neck BMD (g/cm2)`
- # Remove rows with NA values
- tibia_df <- na.omit(tibia_df)
- # General settings
- basepath <- "/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/03_EVALUATION/correlation-matrix/"
- filename <- "hr_pqct_parameters_correlation_matrix_nodaratis_tibia.pdf"
- plot_title <- "HR-pQCT parameters correlation (p<0.005)"
- # Generate correlogram for the tibia dataframe
- generate_tibia_corrplot <- function(df, filename, plot_title, basepath) {
- # Calculate correlation matrix and p-values
- corrmatrix <- cor(as.matrix(df))
- p.mat <- correlation_p_matrix(df)
- # Create the output file
- fname <- file.path(basepath, filename)
- pdf(file = fname, width = 12, height = 12)
- # Set up plot parameters
- par(mar = c(0.1, 0.5, 3, 0.5), oma = c(0, 0, 0, 0), bg = "white", xpd=TRUE)
- pal_colors <- c("#BF360C", "#E64A19", "#FF8A65", "#FFCCBC","#FFFFFF","#7FC8C9", "#35A7A7", "#018786")
- col <- colorRampPalette(pal_colors)
- # Create the correlogram
- corrplot(corrmatrix, method = "color", col = col(200),
- type = "upper", order = "AOE",
- addCoef.col = "black",
- number.font = 1,
- tl.col = "black", tl.srt = 45, tl.cex = 1.25,
- cl.cex = 1.25,
- number.cex = 1.25,
- p.mat = p.mat, sig.level = 0.005, insig = "blank",
- diag = FALSE,
- mar = c(0, 0, 0, 0),
- cl.pos = "r",
- cl.ratio = 0.2,
- cl.align = "c"
- )
- # Add title
- mtext(plot_title, side = 3, line = -5.5, cex = 2.0, font = 2, outer = TRUE)
- dev.off()
- # Create PNG version for display
- png_path <- sub("\\.pdf$", ".png", fname)
- image <- image_read(fname)
- image_write(image, path = png_path, format = "png")
- display_png(file = png_path)
- }
- # Generate the correlogram with just the tibia parameters
- generate_tibia_corrplot(tibia_df, filename, plot_title, basepath)
- # %%
- ### ONLY EVALUATE THE TIBIA
- # Create correlogram on radar-specific parameters (tibia only)
- # Import dataframe
- df <- read.csv('/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/00_DB/HR-pQCT_database_expanded_2025-06-16_16-18.csv', check.names = FALSE)
- # only keep study name Nodaratis
- # df <- df[df$Study == "Nodaratis", ]
- # Remove non-numeric columns
- df_numeric <- df[sapply(df, is.numeric)]
- # Create dataframe with specific columns for Tibia
- # Define mapping of original column names to standardized names
- tibia_cols <- c(
- "Tibia: Tot.vBMD [mg HA/cmm]" = "Tot.vBMD",
- "Tibia: Ct.vBMD [mg HA/cmm]" = "Ct.vBMD",
- "Tibia: Tb.BV/TV [1]" = "Tb.BVTV",
- "Tibia: Relative cortical thickness [-]" = "Rel.Ct.Th",
- "Tibia: y.Force [N]" = "y.Force",
- "Tibia: y.Stress [MPa]" = "y.Stress",
- "Tibia: Ct.Th [mm]" = "Ct.Th",
- "Tibia: Ct.Po [1]" = "Ct.Po",
- "Tibia: Tb.vBMD [mg HA/cmm]" = "Tb.vBMD",
- "Tibia: Tb.N [1/mm]" = "Tb.N",
- "Tibia: Tb.Sp [mm]" = "Tb.Sp",
- "Tibia: Tb.Th [mm]" = "Tb.Th",
- "Tibia: Tb.DA" = "Tb.DA"
- )
- # Extract and rename tibia data
- tibia_df <- df[, names(tibia_cols)]
- colnames(tibia_df) <- tibia_cols
- # Add femoral neck BMD
- tibia_df$Fn.BMD <- df$`Femoral neck BMD (g/cm2)`
- # Remove rows with NA values
- tibia_df <- na.omit(tibia_df)
- # General settings
- basepath <- "/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/03_EVALUATION/03_correlation-matrix/"
- filename <- "hr_pqct_parameters_correlation_matrix_nodaratis_tibia_da_paper.pdf"
- plot_title <- "HR-pQCT Tibia parameters correlation (p<0.005)"
- # Generate correlogram for the tibia dataframe
- generate_tibia_corrplot <- function(df, filename, plot_title, basepath) {
- # Calculate correlation matrix and p-values
- corrmatrix <- cor(as.matrix(df))
- p.mat <- correlation_p_matrix(df)
- # Create the output file
- fname <- file.path(basepath, filename)
- pdf(file = fname, width = 12, height = 12)
- # Set up plot parameters
- par(mar = c(0.1, 0.5, 3, 0.5), oma = c(0, 0, 0, 0), bg = "white", xpd=TRUE)
- pal_colors <- c("#BF360C", "#E64A19", "#FF8A65", "#FFCCBC","#FFFFFF","#7FC8C9", "#35A7A7", "#018786")
- col <- colorRampPalette(pal_colors)
- # Create the correlogram
- corrplot(corrmatrix, method = "color", col = col(200),
- type = "upper", order = "AOE",
- addCoef.col = "black",
- number.font = 1,
- tl.col = "black", tl.srt = 45, tl.cex = 1.25,
- cl.cex = 1.25,
- number.cex = 1.25,
- p.mat = p.mat, sig.level = 0.005, insig = "blank",
- diag = FALSE,
- mar = c(0, 0, 0, 0),
- cl.pos = "r",
- cl.ratio = 0.2,
- cl.align = "c"
- )
- # Add title
- mtext(plot_title, side = 3, line = -5.5, cex = 2.0, font = 2, outer = TRUE)
- dev.off()
- # Create PNG version for display
- png_path <- sub("\\.pdf$", ".png", fname)
- image <- image_read(fname)
- image_write(image, path = png_path, format = "png")
- display_png(file = png_path)
- }
- # Generate the correlogram with just the tibia parameters
- generate_tibia_corrplot(tibia_df, filename, plot_title, basepath)
- # %%
- ### ONLY EVALUATE THE RADIUS
- # Create correlogram on radar-specific parameters (tibia only)
- # only keep study name Nodaratis
- # df <- df[df$Study == "Nodaratis", ]
- # Remove non-numeric columns
- df_numeric <- df[sapply(df, is.numeric)]
- # Create dataframe with specific columns for Radius
- # Define mapping of original column names to standardized names
- radius_cols <- c(
- "Radius: Tot.vBMD [mg HA/cmm]" = "Tot.vBMD",
- "Radius: Ct.vBMD [mg HA/cmm]" = "Ct.vBMD",
- "Radius: Tb.BV/TV [1]" = "Tb.BVTV",
- "Radius: Relative cortical thickness [-]" = "Rel.Ct.Th",
- "Radius: Area ratio (Ct./Tb.) [-]" = "Ct./Tb.Ar",
- "Radius: y.Force [N]" = "y.Force",
- "Radius: y.Stress [MPa]" = "y.Stress",
- "Radius: Ct.Th [mm]" = "Ct.Th",
- "Radius: Ct.Po [1]" = "Ct.Po",
- "Radius: Tb.vBMD [mg HA/cmm]" = "Tb.vBMD",
- "Radius: Tb.N [1/mm]" = "Tb.N",
- "Radius: Tb.Sp [mm]" = "Tb.Sp",
- "Radius: Tb.Th [mm]" = "Tb.Th",
- "Radius: Tb.DA" = "Tb.DA"
- )
- # Extract and rename radius data
- radius_df <- df[, names(radius_cols)]
- colnames(radius_df) <- radius_cols
- # Add femoral neck BMD
- radius_df$Fn.BMD <- df$`Femoral neck BMD (g/cm2)`
- # Remove rows with NA values
- radius_df <- na.omit(radius_df)
- # General settings
- basepath <- "/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/03_EVALUATION/03_correlation-matrix/"
- filename <- "hr_pqct_parameters_correlation_matrix_nodaratis_radius_da_paper.pdf"
- plot_title <- "HR-pQCT Radius parameters correlation (p<0.005)"
- # Generate correlogram for the radius dataframe
- generate_radius_corrplot <- function(df, filename, plot_title, basepath) {
- # Calculate correlation matrix and p-values
- corrmatrix <- cor(as.matrix(df))
- p.mat <- correlation_p_matrix(df)
- # Create the output file
- fname <- file.path(basepath, filename)
- pdf(file = fname, width = 12, height = 12)
- # Set up plot parameters
- par(mar = c(0.1, 0.5, 3, 0.5), oma = c(0, 0, 0, 0), bg = "white", xpd=TRUE)
- pal_colors <- c("#BF360C", "#E64A19", "#FF8A65", "#FFCCBC","#FFFFFF","#7FC8C9", "#35A7A7", "#018786")
- col <- colorRampPalette(pal_colors)
- # Create the correlogram
- corrplot(corrmatrix, method = "color", col = col(200),
- type = "upper", order = "AOE",
- addCoef.col = "black",
- number.font = 1,
- tl.col = "black", tl.srt = 45, tl.cex = 1.25,
- cl.cex = 1.25,
- number.cex = 1.25,
- p.mat = p.mat, sig.level = 0.005, insig = "blank",
- diag = FALSE,
- mar = c(0, 0, 0, 0),
- cl.pos = "r",
- cl.ratio = 0.2,
- cl.align = "c"
- )
- # Add title
- mtext(plot_title, side = 3, line = -5.5, cex = 2.0, font = 2, outer = TRUE)
- dev.off()
- # Create PNG version for display
- png_path <- sub("\\.pdf$", ".png", fname)
- image <- image_read(fname)
- image_write(image, path = png_path, format = "png")
- display_png(file = png_path)
- }
- # Generate the correlogram with just the radius parameters
- generate_radius_corrplot(tibia_df, filename, plot_title, basepath)
- # %%
correlation-matrix-database.ipynb at commit 987628e, under GPL-3.0 · at the source
Overview
- ARTORG Center for Biomedical Engineering Research, University of Bern, 3010 Bern, Switzerland
- Department of Osteoporosis, Bern University Hospital, 3010 Bern, Switzerland
- Division of Endocrinology, University Hospital Basel, 4031 Basel, Switzerland
Abstract
HRpQCT is emerging as a promising evolution to DXA for longitudinal assessment of bone properties and strength estimation beyond FN aBMD, as it provides a detailed 3D representation and separate quantification of trabecular and cortical compartments. Reference data exist for thin single stacks of 10.2 mm in second-generation HRpQCT, but these sections may not fully capture clinically relevant fracture locations and pose challenges for longitudinal monitoring due to their limited thickness. Reported parameters are mainly size-dependent properties susceptible to bias from skeletal dimensions, potentially concealing changes in bone quality at the material level. Moreover, microstructural parameters are derived from densitometric information, making them partially redundant. This study provides the first age-, sex-, and site-specific reference data for a novel multi-stack on second-generation HRpQCT at the distal radius and tibia in 381 healthy participants (144F, 237M) from a primarily Caucasian population aged 20-92 yr and identifies the size-independent parameters most sensitive to age for improved bone health assessment. Six size-independent parameters relevant for estimated mechanical properties or exhibiting short trend assessment intervals were selected as candidates for improved bone health assessment: 2 densitometric properties (total volumetric BMD, cortical volumetric BMD), 1 size-independent geometrical property (relative cortical thickness), 2 microstructural properties (trabecular degree of anisotropy, trabecular bone volume over total volume), and 1 mechanical property (apparent yield stress [appσy]) estimated by homogenized finite elements. Intensive mechanical properties provided more sensitive follow-up estimations. Cortical volumetric BMD, especially in the weight-bearing tibia in women, was the most sensitive with age. Matched comparisons with single-stack counterparts demonstrated good agreement between densitometric and microstructural properties, supporting potential cross-study and cross-protocol comparisons. The present work proposes an alternative set of size-independent variables for multi-stack HRpQCT, which may offer a refined assessment of bone health and longitudinal monitoring.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 10 matches between paragraphs and lines of code.
Zenodo 19661364
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
- 30 September 2026: the link answers (HTTP 200)
25 files
- 01_CODE/
__init__.py , Python, 1 line - 01_CODE/
main.py , Python, 174 lines - 01_CODE/
setup.py , Python, 5 lines - 01_CODE/
src/ , Python, 1 linehrpqct_database/ __init__.py - 01_CODE/
src/ , Python, 624 lineshrpqct_database/ dataclasses_hrpqct.py - 01_CODE/
src/ , Python, 1,555 lineshrpqct_database/ db_converter.py - 01_CODE/
src/ , Python, 240 lineshrpqct_database/ export_combined_database .py - 01_CODE/
src/ , Python, 427 lineshrpqct_database/ gen_pdf.py - 01_CODE/
src/ , Python, 55 lineshrpqct_database/ plotly_template.py - 01_CODE/
src/ , Python, 41 lineshrpqct_database/ reference_values.py - 01_CODE/
src/ , Python, 2,619 lineshrpqct_database/ statistics_hrpqct.py - 01_CODE/
src/ , Python, 1 linehrpqct_database/ utils/ __init__.py - 01_CODE/
src/ , Python, 135 lineshrpqct_database/ utils/ expand_database.py - 03_EVALUATION/
01_demographics/ , R, 205 linesdemographics.R - 03_EVALUATION/
01_demographics/ , R, 137 linesfrax.R - 03_EVALUATION/
02_extensive-intensive/ , Jupyter, 571 linesextensive_intensive.ipyn b - 03_EVALUATION/
03_correlation-matrix/ , Jupyter, 671 linescorrelation-matrix-datab ase.ipynb - 03_EVALUATION/
04_rate-change/ , Jupyter, 365 linesdescriptive_statistics_p aper.ipynb - 03_EVALUATION/
04_rate-change/ , Jupyter, 469 linesprecision_error/ gluer_repro_michi_data.i pynb - 03_EVALUATION/
04_rate-change/ , Jupyter, 544 linesprecision_error/ gluer_reproducibility.ip ynb - 03_EVALUATION/
05_radar-plots/ , Jupyter, 209 linesstatistics_age_sex_site. ipynb - 03_EVALUATION/
06_quadratic-fit-paramet , R, 389 linesers-tables/ 02_Model.R - 03_EVALUATION/
06_quadratic-fit-paramet , Jupyter, 138 linesers-tables/ quadratic-fit.ipynb - LICENSE, License, 674 lines
- README.md, Text, 25 lines
artorg-unibe-ch/hrpqct-multistack-db
987628e7414c0542f43d726434ba0d966fdfbe46, 20 April 2026Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
25 files
- 01_CODE/
__init__.py , Python, 1 line - 01_CODE/
main.py , Python, 174 lines - 01_CODE/
setup.py , Python, 5 lines - 01_CODE/
src/ , Python, 1 linehrpqct_database/ __init__.py - 01_CODE/
src/ , Python, 624 lines, 2 matcheshrpqct_database/ dataclasses_hrpqct.py - 01_CODE/
src/ , Python, 1,555 lines, 2 matcheshrpqct_database/ db_converter.py - 01_CODE/
src/ , Python, 240 lineshrpqct_database/ export_combined_database .py - 01_CODE/
src/ , Python, 427 lineshrpqct_database/ gen_pdf.py - 01_CODE/
src/ , Python, 55 lineshrpqct_database/ plotly_template.py - 01_CODE/
src/ , Python, 41 lineshrpqct_database/ reference_values.py - 01_CODE/
src/ , Python, 2,619 lines, 1 matchhrpqct_database/ statistics_hrpqct.py - 01_CODE/
src/ , Python, 1 linehrpqct_database/ utils/ __init__.py - 01_CODE/
src/ , Python, 135 lineshrpqct_database/ utils/ expand_database.py - 03_EVALUATION/
01_demographics/ , R, 205 linesdemographics.R - 03_EVALUATION/
01_demographics/ , R, 137 lines, 1 matchfrax.R - 03_EVALUATION/
02_extensive-intensive/ , Jupyter, 571 linesextensive_intensive.ipyn b - 03_EVALUATION/
03_correlation-matrix/ , Jupyter, 671 lines, 3 matchescorrelation-matrix-datab ase.ipynb - 03_EVALUATION/
04_rate-change/ , Jupyter, 365 lines, 1 matchdescriptive_statistics_p aper.ipynb - 03_EVALUATION/
04_rate-change/ , Jupyter, 469 linesprecision_error/ gluer_repro_michi_data.i pynb - 03_EVALUATION/
04_rate-change/ , Jupyter, 544 linesprecision_error/ gluer_reproducibility.ip ynb - 03_EVALUATION/
05_radar-plots/ , Jupyter, 209 linesstatistics_age_sex_site. ipynb - 03_EVALUATION/
06_quadratic-fit-paramet , R, 389 linesers-tables/ 02_Model.R - 03_EVALUATION/
06_quadratic-fit-paramet , Jupyter, 138 linesers-tables/ quadratic-fit.ipynb - LICENSE, License, 674 lines
- README.md, Text, 27 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 46 scripts, each with its path and the digest of its content;
- 10 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
The processing code supporting the findings of this study is publicly available.46 The underlying data cannot be made publicly available owing to privacy and ethical constraints; however, data may be made available upon reasonable request to the corresponding author.
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 6 keywords, 1 funder, 44 references.
Cite
This paper
Poncioni, S., Lüscher, D., Indermaur, M., Frauchiger, D. A., Meier, C., Zysset, P., & Lippuner, K. (2026). Sex- and site-specific reference data for size-invariant properties using multi-stack HRpQCT. JBMR plus, 10(6), ziag077. https://
BibTeX
@article{poncioni2026sex
author = {Poncioni, Simone and Lüscher, Dominique and Indermaur, Michael and Frauchiger, Daniela A and Meier, Christian and Zysset, Philippe and Lippuner, Kurt},
title = {{Sex- and site-specific reference data for size-invariant properties using multi-stack HRpQCT}},
journal = {JBMR plus},
year = {2026},
month = apr,
volume = {10},
number = {6},
pages = {ziag077},
publisher = {Oxford University Press},
issn = {2473-4039},
doi = {10.1093/
url = {https://
pmid = {42186504},
pmcid = {PMC13198809}
}
RIS
TY - JOUR
AU - Poncioni, Simone
AU - Lüscher, Dominique
AU - Indermaur, Michael
AU - Frauchiger, Daniela A
AU - Meier, Christian
AU - Zysset, Philippe
AU - Lippuner, Kurt
TI - Sex- and site-specific reference data for size-invariant properties using multi-stack HRpQCT
T2 - JBMR plus
J2 - JBMR Plus
PY - 2026
DA - 2026/
VL - 10
IS - 6
SP - ziag077
SN - 2473-4039
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"type": "article-journal",
"title": "Sex- and site-specific reference data for size-invariant properties using multi-stack HRpQCT",
"container-title": "JBMR plus",
"author": [
{
"family": "Poncioni",
"given": "Simone"
},
{
"family": "Lüscher",
"given": "Dominique"
},
{
"family": "Indermaur",
"given": "Michael"
},
{
"family": "Frauchiger",
"given": "Daniela A"
},
{
"family": "Meier",
"given": "Christian"
},
{
"family": "Zysset",
"given": "Philippe"
},
{
"family": "Lippuner",
"given": "Kurt"
}
],
"container-title-short":
"volume": "10",
"issue": "6",
"page": "ziag077",
"DOI": "10.1093/
"PMID": "42186504",
"PMCID": "PMC13198809",
"ISSN": "2473-4039",
"publisher": "Oxford University Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
25
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1016/j.xcrm.2026.102766 [code]
- A longitudinal single-cell and spatial multiomic atlas of pediatric high-grade glioma.Journal: Cell reports. MedicineIn common: car, lmerTest, Plotly, 10 other tools
- [2] doi:10.1093/braincomms/fcag176 [code]
- Tau topography subtypes account for clinical heterogeneity and longitudinal trajectories in early-onset Alzheimer's disease.Journal: Brain communicationsIn common: car, lmerTest, Plotly, 10 other tools
- [3] doi:10.34133/csbj.0042 [code]
- Using Steady-State Visual Evoked Potentials to Characterize Wide-Ranging Retinopathy Linked to &
lt;i& gt;CRB1& lt;/ i& gt;: Implications for Clinical Trials. Journal: Computational and structural biotechnology journalIn common: car, lmerTest, Plotly, 10 other tools - [4] doi:10.1093/bioinformatics/btag592 [code]
- Network-based stratification of allele-specific expression reveals patient subgroups in Huntington's disease.Journal: Bioinformatics (Oxford, England)In common: car, Plotly, lme4, 8 other tools
- [5] doi:10.1093/braincomms/fcag121 [code]
- Anterior insular co-activation patterns associated with stress markers in chronic primary pain.Journal: Brain communicationsIn common: car, lmerTest, Plotly, 7 other tools
- [6] doi:10.1371/journal.pone.0345651 [code]
- Non-concussive head impacts sustained during American football correlate with changes in gut microbiome diversity and composition.Journal: PloS oneIn common: car, lmerTest, lme4, 8 other tools
- [7] doi:10.3389/fnhum.2026.1839961 [code]
- Developmental stability of task-rest neural efficiency in youth using a threat and cognitive control task.Journal: Frontiers in human neuroscienceIn common: car, lmerTest, lme4, 8 other tools
- [8] doi:10.1016/j.nicl.2026.104012 [code]
- Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.Journal: NeuroImage. ClinicalIn common: car, lmerTest, lme4, 8 other tools
- [9] doi:10.1038/s41467-026-71428-6 [code]
- Binding items to contexts through conjunctive neural representations with the method of loci.Journal: Nature communicationsIn common: lmerTest, Plotly, lme4, 8 other tools
- [10] doi:10.1093/nc/niag029 [code]
- A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.Journal: Neuroscience of consciousnessIn common: car, lmerTest, cowplot, 8 other tools
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 46 scripts, and 10 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:1fa31e3d5ed75d46…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
