Robust but independent sex differences in human brain function, structure, and behavior.
17 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 22 matches · 2 of them tie a paragraph to a whole file without given lines: weak matches, whose lines are not tinted
- [1] § Methods › Participants and data preparation › Participants ↔ scripts/Script13_readUKBsMRIdata.R, lines 1 to 59 · score 0.93 · healthy UK Biobank, UK Biobank participant, youngest subset, closely match, 44–50, age range · block
oscr:b:TSQN6TCZ0QVQM-1· Report a mismatch - [2] § Methods › Participants and data preparation › Participants ↔ scripts/Script14_SexAnatomyUKB.R, lines 1 to 32 · score 0.81 · healthy UK Biobank, youngest subset, UK Biobank participant, 44–50, mm, anatomy · block
oscr:b:QJS7HPTDET14K-J· Report a mismatch - [3] § Methods › Cross-validation of anatomical sex differences and sex prediction in the UK Biobank dataset ↔ scripts/Script14_SexAnatomyUKB.R, lines 1 to 32 · score 0.72 · UK Biobank, FreeSurfer, cortical thickness, surface area, Euler, GMV · block
oscr:b:QJS7HPTDET14K-J· Report a mismatch - [4] § Methods › Cross-validation of anatomical sex differences and sex prediction in the UK Biobank dataset ↔ scripts/Script13_readUKBsMRIdata.R, lines 1 to 59 · score 0.72 · UK Biobank, FreeSurfer, cortical thickness, surface area, Euler, GMV · block
oscr:b:TSQN6TCZ0QVQM-1· Report a mismatch - [5] § Methods › Predicting sex using fMRI, structural MRI, and behavioral data ↔ scripts/Script16_PredictSexActivation_TaskSpecificRegion.R, the whole file · a weak match · score 0.72 · fold cross validation, predicted sex, prediction models, PLS, ROC, tuning · block
oscr:b:JSK69XKC2HVKA-S· Report a mismatch - [6] § Results › Males and females show broadly similar brain-wide association study signals with a few isolated exceptions ↔ scripts/Script44_BWAS_SexComparison.R, lines 152 to 207 · score 0.70 · topographic divergence score, sex shuffled, Bonferroni correction, TDSs, behavioral scale, Pperm · block
oscr:b:69DD34QWHPMWA-X· Report a mismatch - [7] § Results › Brain-wide association studies link behavior and task-induced brain activation within each sex ↔ scripts/Script44_BWAS_SexComparison.R, lines 152 to 207 · score 0.69 · topographical divergence scores, sex shuffling, Bonferroni corrected, TDSs, Scatter, density · block
oscr:b:69DD34QWHPMWA-X· Report a mismatch - [8] § Methods › Predicting sex using fMRI, structural MRI, and behavioral data ↔ scripts/Script29_PredictSexBehavior_Permutation.R, lines 1 to 87 · score 0.68 · predicted sex, prediction models, MICE, imputed, behavioral scale, caret · block
oscr:b:344FQ5B54ARPP-P· Report a mismatch - [9] § Methods › Clustering task-specific sex differences in brain activation ↔ scripts/Script6_ClusteringTaskSpecificRegions.R, lines 1 to 40 · score 0.68 · iter.max, kmeans clustering, scree, nstart, matrix, activation · block
oscr:b:KZMAPYHNAXNS6-L· Report a mismatch - [10] § Methods › Testing inter-domain correlations of sex typicality across individuals ↔ scripts/Script37_PredictSex_STS.R, lines 411 to 461 · score 0.67 · sex probability scores, sex typicality, misclassified, STSs, sex prediction, volume · block
oscr:b:BN37T7HDQDS5W-C· Report a mismatch - [11] § Methods › Clustering task-specific sex differences in brain activation › Testing for alignment of task-specific and task-general sex differences in activation with functional anatomy of the human brai ↔ scripts/Script7_TaskSpecificGeneral_Enrichment.R, lines 271 to 323 · score 0.65 · markello_spatialnulls, topic map, Yeo, Neurosynth, network, Spin · block
oscr:b:223PDGZC3D6ZG-Y· Report a mismatch - [12] § Methods › Participants and data preparation › Structural MRI data ↔ scripts/Script10_readHCPsMRIdata.R, lines 1 to 54 · score 0.65 · FreeSurfer, cortical thickness, surface area, recon, Euler, parcellate · block
oscr:b:WNY2VZX4HWSWX-A· Report a mismatch - [13] § Methods › Brain-wide association studies (BWASs) between activation and behavior › Comparing the topography of brain-behavior associations between sexes ↔ scripts/Script44_BWAS_SexComparison.R, lines 1 to 26 · score 0.63 · topographical divergence, activation behavior associations, dissimilar, TDS, score, males · block
oscr:b:35G0N4MSWBN78-X· Report a mismatch - [14] § Methods › Participants and data preparation › Structural MRI data ↔ scripts/Script11_SexAnatomyHCP.R, lines 1 to 32 · score 0.62 · FreeSurfer, cortical thickness, surface area, vertex, anatomy, volume · block
oscr:b:MNC9Y1BTN9CY9-N· Report a mismatch - [15] § Methods › Participants and data preparation › Behavioral data ↔ scripts/Script46_BWAS_SexModulation_OmnibusDesnityPlot_RankedDotPlot.R, lines 58 to 142 · score 0.62 · scanner tasks, alertness, personality, psychiatric, sensory, behavioral scales · block
oscr:b:7HRRTJRNZEFS8-X· Report a mismatch - [16] § Methods › Participants and data preparation › Behavioral data ↔ scripts/Script15_SexBehavior.R, lines 145 to 232 · score 0.61 · scanner tasks, alertness, personality, psychiatric, sensory, behavioral scales · block
oscr:b:N6XMVG6FXHYHH-N· Report a mismatch - [17] § Methods › Brain-wide association studies (BWASs) between activation and behavior › Sex stratified BWAS ↔ scripts/Script42_BWAS_MaleFemale_SplitHalf.R, lines 1 to 17 · score 0.57 · repeating BWAS, randomly splitting, behavioral scale, fMRI, Pperm, brain activation · block
oscr:b:905AMS49Y8YSX-G· Report a mismatch - [18] § Methods › Analysis of fMRI data › Testing for task-specific and task-general SDA ↔ scripts/Script5_SexAcrossTasks.R, lines 1 to 47 · score 0.54 · linear mixed, lme4, lmer, fMRI, parcellation, models · block
oscr:b:E6RRRC53SB5FB-Q· Report a mismatch - [19] § Methods › Participants and data preparation › Task fMRI data ↔ scripts/Script4_SexPerTask_Covary.R, lines 42 to 127 · score 0.52 · working memory, linear model, filtering, emotion, language · block
oscr:b:WR1X8K56SNVBD-Y· Report a mismatch - [20] § Results › Multivariate patterns of brain activation, brain anatomy, and behavior are all highly but orthogonally predictive of participant sex ↔ scripts/Script16_PredictSexActivation_TaskSpecificRegion.R, the whole file · a weak match · score 0.52 · fold cross validation, sex prediction accuracy, MRI, GMV, maps, model · block
oscr:b:JSK69XKC2HVKA-S· Report a mismatch - [21] § Methods › Analysis of structural MRI data ↔ scripts/Script14_SexAnatomyUKB.R, lines 167 to 224 · score 0.51 · cortical thickness, FDR correction, effectsize, Cohen, anatomy, GMV · block
oscr:b:RS15VRP8CMG27-7· Report a mismatch - [22] § Results › Humans show both task-specific and task-general sex differences in brain activation ↔ scripts/Script4_SexPerTask_Covary.R, lines 42 to 127 · score 0.51 · eta squared, language task, median, emotion, FDR, maps · block
oscr:b:WR1X8K56SNVBD-Y· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R · 304 lines · 12 KB · no license · 3 matches
- ####################################################
- ### Script 14: Calculate Sex differences in
- ### FreeSurfer volume (FSV or Gray Matter Volume), Surface Area (SA), Cortical Thickness (CT) in Glasser
- ### from the youngest subset of healthy UK Biobank participants (44-50 years; 529 males and 637 females)
- ### with euler greater than -217 (GMV,CT,SA: Fig. S12a-b, Source Data)
- ####################################################
- ### SET UP ###
- library(lme4)
- library(tidyverse)
- library(lmerTest)
- library(furrr)
- library(tictoc)
- library(limma)
- library(genio)
- library(ciftiTools)
- ciftiTools.setOption("wb_path", "/usr/local/apps/connectome-workbench/1.5.0/wb_command")
- library(freesurfer)
- library(ggplot2)
- library(patchwork)
- library(GetoptLong)
- library(lsr) #eta-Squared
- library(effectsize)
- ####Function to write cifti in Glasser parcellation
- # function to assign value of each parcel in HCP/MMP/Glasser parcellation to vertices in that parcel in CIFTI
- # MMP parcellation (download from HCP S1200 group results)P
- MMP <- read_cifti("../data/HCP_S1200_GroupAvg_v1/Q1-Q6_RelatedValidation210.CorticalAreas_dil_Final_Final_Areas_Group_Colors.32k_fs_LR.dlabel.nii")
- # adjust each atlas into vector of assignments and dataframe for meta
- MMPleft <- as.vector(MMP$data$cortex_left)
- MMPright <- as.vector(MMP$data$cortex_right)
- MMPmeta <- as.data.frame(MMP$meta$cifti$labels$INDEXMAX)
- adata <- c(MMPleft,MMPright)
- mdata <- MMPmeta
- assign_value <- function(data) {
- arange <- c(181:360,1:180)#make sure left first (181:360), right second(1:180)
- res <- matrix(rep(0, length(adata)*1), ncol=1)
- temp <- adata
- for (m in 1:length(arange))
- {
- # find avg beta (by region)
- res[which(adata==arange[m])] <- data[m]
- }
- return(res)
- }
- # need to load one cifti dscalar file downloaded from HCP S1200 as a cfiti structure holder,
- # e.g., one file from xxxxx(one particpant)/MNINonLinear/Results/tfMRI_MOTOR/tfMRI_MOTOR_hp200_s4_level2.feat/motor_contrast.dscalar.nii
- test <- read_cifti("../data/motor_contrast.dscalar.nii", brainstructures = "all")
- # function to write Glasser Parcellated results to cifti
- write_glasser_cifti <- function(gdata,gname,ciftiname){
- tstats_vis <- test # initialize structure
- if (is.null(dim(gdata))) {
- cifti_data <- as.vector(assign_value(gdata))
- tstats_vis$data$cortex_left <- as.matrix(cifti_data[1:29696])
- tstats_vis$data$cortex_right <- as.matrix(cifti_data[29697:59412])
- tstats_vis$data$subcort <- matrix(rep(0,31870),ncol = 1)
- } else {
- cifti_data <- matrix(rep(0,59412*ncol(gdata)),ncol = ncol(gdata))
- for (m in 1:ncol(gdata)) {
- cifti_data[,m] <- as.vector(assign_value(gdata[,m]))
- }
- tstats_vis$data$cortex_left <- as.matrix(cifti_data[1:29696,])
- tstats_vis$data$cortex_right <- as.matrix(cifti_data[29697:59412,])
- tstats_vis$data$subcort <- matrix(rep(0,31870*ncol(gdata)),ncol = ncol(gdata))
- }
- # names
- tstats_vis$meta$cifti$names <- gname
- write_cifti(tstats_vis, ciftiname)
- }
- # Function: Spin tests of Pearson correlation between A and B data
- # across regions in Glasser (with the 10000 spin index created in fsaverage)
- spintest <- function(dataA,dataB,Alab,Blab,fname,fname2) {
- # use cortical MMP/Glasser atlas
- dfcor <-data.frame(A=dataA, B=dataB)
- # calculate the observed correlation
- cor_obs <- cor(dfcor$A,dfcor$B)
- # load indexes of spin 1000 generated by markello_spatialnulls
- sIndex <- read_matrix("../data/Glasser_fsa5_spin10000.txt") +1 #index starts from 0 instead of 1
- # build null using spin index
- permn <- ncol(sIndex)
- cor_null <- rep(NaN, permn)
- for (n in 1:permn)
- {
- Anull <- dfcor$A[sIndex[,n]]# rotate A
- cor_null[n] <- cor(dfcor$B,Anull)
- }
- #using abs to calculate p perm for a two-sided test
- p_perm <- length(which(abs(cor_null)>abs(cor_obs)))/permn
- # plot A (on y axis) vs. B (on x axis)
- ti=paste0("Correlation of ",Alab," and ",Blab, " across Glasser regions:")
- fit <- lm(A ~ B, data = dfcor)
- p <- ggplot(dfcor, aes(y = A, x = B)) +
- geom_point(color='black') +
- stat_smooth(size=2,method = "lm", se=FALSE,color="grey",show.legend = TRUE)+
- labs(y= Alab,
- x=Blab,
- title = paste(ti,"r =",signif(cor_obs,2)," p_spin =",signif(p_perm, 4))) +
- theme_classic() +
- theme(legend.position = c(.95, .9),
- legend.justification = c("right", "top"),
- legend.box.just = "right",
- legend.margin = margin(6, 6, 6, 6))
- print(p)
- ggsave(fname,height=6, width=6)
- #write source data
- colnames(dfcor)[1:2] <- c("CohenDinHCP","CohenDinUKB")
- write.csv(dfcor,row.names = FALSE,
- file = fname2)
- return(p)
- }
- ####################################################
- #Run lm model to identify sex effect in GMV
- # load data
- load(file = "../data/UKB_GMV_Glasser.RData")
- participant_id <- as.factor(FSV_wide_UKB$participant_id)
- sex <- as.factor(FSV_wide_UKB$sex)
- age <- FSV_wide_UKB$age
- tgmv <- FSV_wide_UKB$tgmv_FS741 # using tgmv from FS741 done by myslef
- inputs <- map(as.list(FSV_wide_UKB[,-c(1:6)]), function(x){
- d <- data.frame(participant_id = participant_id,
- age = age,
- sex=sex,
- tgmv=tgmv,
- voxel = x)
- return(d)
- })
- # lm model to identify sex effects while covarying total GMV
- results_list_sum <- map(inputs, function(d){
- res <- lm(formula = voxel ~ age + sex + tgmv, data = d)
- sum <- summary(res)
- etaS <- eta_squared(car::Anova(res,type = 2)) #type 2 partial eta-squared for effect size
- sum$etaS <- etaS
- return(sum)
- })
- # build data frame to hold sex effects
- sex_t <- map_dfr(results_list_sum, function(x){
- df <- data.frame(t_stat = x$coefficients[3,"t value"],
- p_val = x$coefficients[3,"Pr(>|t|)"],
- etaS = x$etaS$Eta2_partial[2]*sign(x$coefficients[3,"t value"])) #add sign to effect size
- return(df)
- })
- rownames(sex_t) <- names(results_list_sum)
- # calculate FDR-corrected p-values
- sex_t <- sex_t %>%
- mutate(fdr_p = p.adjust(p = p_val, method = "fdr"),
- BF_p = p.adjust(p = p_val, method = "bonferroni"),
- sig = ifelse(test = fdr_p < 0.05, yes = 1, no = 0),
- logFDR =-log10(fdr_p),
- t_thresholded = t_stat*sig,
- etaS_thresholded = etaS*sig)
- # calculate cohen's d using t_to_d from effectsize package
- tempcd <- t_to_d(t = sex_t$t_stat,df=1160)
- sex_t$cohend <- tempcd$d
- sex_t$cohend_thresholded <- sex_t$cohend*sex_t$sig
- # save results
- save(sex_t,file = "../data/SexGMV_UKBresults_Glasser.RData")
- write_glasser_cifti(as.matrix(sex_t),colnames(sex_t),
- "../outputs/SexGMV_UKBresults_Glasser.dscalar.nii")#use wb_view to load this cifit file: t_thresholded for Fig. 12a
- # compare effect size results from HCP and UKB for sex differences in sMRI
- sex_t_UKB <- sex_t
- load(file = "../data/SexGMV_HCPresults_Glasser.RData")
- tempcd <- t_to_d(t = sex_t$t_stat,df=959)
- cor(sex_t$cohend,sex_t_UKB$cohend)
- #Fig. S12b and source data
- spintest(sex_t$cohend,sex_t_UKB$cohend,'HCP_cohenD','UKB_cohenD',
- '../outputs/ROIbasedCorr_CohenD_MF_GMV_HCP_UKB_MMPatlas_SpinTest10000.pdf',
- '../outputs/ROIbasedCorr_CohenD_MF_GMV_HCP_UKB_MMPatlas_SpinTest10000.csv')
- ####################################################
- #Run lm model to identify sex effect in CT
- # load data
- load(file = "../data/UKB_CT_Glasser.RData")
- participant_id <- as.factor(FSthick_wide_UKB$participant_id)
- sex <- as.factor(FSthick_wide_UKB$sex)
- age <- FSthick_wide_UKB$age
- avgCT <- FSthick_wide_UKB$avgCT# average cortical thickness
- inputs <- map(as.list(FSthick_wide_UKB[,-c(1:6)]), function(x){
- d <- data.frame(participant_id = participant_id,
- age = age,
- sex=sex,
- avgCT=avgCT,
- voxel = x)
- return(d)
- })
- # lm model to identify sex effects while covarying avg CT
- results_list_sum <- map(inputs, function(d){
- res <- lm(formula = voxel ~ age + sex + avgCT, data = d)
- sum <- summary(res)
- etaS <- eta_squared(car::Anova(res,type = 2)) #type 2 partial eta-squared for effect size
- sum$etaS <- etaS
- return(sum)
- })
- # build data frame to hold sex effects
- sex_t <- map_dfr(results_list_sum, function(x){
- df <- data.frame(t_stat = x$coefficients[3,"t value"],
- p_val = x$coefficients[3,"Pr(>|t|)"],
- etaS = x$etaS$Eta2_partial[2]*sign(x$coefficients[3,"t value"])) #add sign to effect size
- return(df)
- })
- rownames(sex_t) <- names(results_list_sum)
- # calculate FDR-corrected p-values
- sex_t <- sex_t %>%
- mutate(fdr_p = p.adjust(p = p_val, method = "fdr"),
- BF_p = p.adjust(p = p_val, method = "bonferroni"),
- sig = ifelse(test = fdr_p < 0.05, yes = 1, no = 0),
- logFDR =-log10(fdr_p),
- t_thresholded = t_stat*sig,
- etaS_thresholded = etaS*sig)
- # calculate cohen's d using t_to_d from effectsize package
- tempcd <- t_to_d(t = sex_t$t_stat,df=1160)
- sex_t$cohend <- tempcd$d
- sex_t$cohend_thresholded <- sex_t$cohend*sex_t$sig
- # save results
- save(sex_t,file = "../data/SexCT_UKBresults_Glasser.RData")
- write_glasser_cifti(as.matrix(sex_t),colnames(sex_t),
- "../outputs/SexCT_UKBresults_Glasser.dscalar.nii")
- #use wb_view to load this cifit file: t_thresholded for Fig. S12a
- # compare effect size results from HCP and UKB for sex differences in sMRI
- sex_t_UKB <- sex_t
- load(file = "../data/SexCT_HCPresults_Glasser.RData")
- cor(sex_t$cohend,sex_t_UKB$cohend)
- #Fig. S12b and source data
- spintest(sex_t$cohend,sex_t_UKB$cohend,'HCP_cohenD','UKB_cohenD',
- '../outputs/ROIbasedCorr_CohenD_MF_CT_HCP_UKB_MMPatlas_SpinTest10000.pdf',
- '../outputs/ROIbasedCorr_CohenD_MF_CT_HCP_UKB_MMPatlas_SpinTest10000.cvf')
- ####################################################
- #Run lm model to identify sex effect in SA
- # load data
- load(file = "../data/UKB_SA_Glasser.RData")
- participant_id <- as.factor(FSsurfacearea_wide_UKB$participant_id)
- sex <- as.factor(FSsurfacearea_wide_UKB$sex)
- age <- FSsurfacearea_wide_UKB$age
- totalSA <- FSsurfacearea_wide_UKB$totalSA# total surface area
- inputs <- map(as.list(FSsurfacearea_wide_UKB[,-c(1:6)]), function(x){
- d <- data.frame(participant_id = participant_id,
- age = age,
- sex=sex,
- totalSA=totalSA,
- voxel = x)
- return(d)
- })
- # lm model to identify sex effects while covarying total SA
- results_list_sum <- map(inputs, function(d){
- res <- lm(formula = voxel ~ age + sex + totalSA, data = d)
- sum <- summary(res)
- etaS <- eta_squared(car::Anova(res,type = 2)) #type 2 partial eta-squared for effect size
- sum$etaS <- etaS
- return(sum)
- })
- # build data frame to hold sex effects
- sex_t <- map_dfr(results_list_sum, function(x){
- df <- data.frame(t_stat = x$coefficients[3,"t value"],
- p_val = x$coefficients[3,"Pr(>|t|)"],
- etaS = x$etaS$Eta2_partial[2]*sign(x$coefficients[3,"t value"])) #add sign to effect size
- return(df)
- })
- rownames(sex_t) <- names(results_list_sum)
- # calculate FDR-corrected p-values
- sex_t <- sex_t %>%
- mutate(fdr_p = p.adjust(p = p_val, method = "fdr"),
- BF_p = p.adjust(p = p_val, method = "bonferroni"),
- sig = ifelse(test = fdr_p < 0.05, yes = 1, no = 0),
- logFDR =-log10(fdr_p),
- t_thresholded = t_stat*sig,
- etaS_thresholded = etaS*sig)
- # calculate cohen's d using t_to_d from effectsize package
- tempcd <- t_to_d(t = sex_t$t_stat,df=1160)
- sex_t$cohend <- tempcd$d
- sex_t$cohend_thresholded <- sex_t$cohend*sex_t$sig
- # save results
- save(sex_t,file = "../data/SexSA_UKBresults_Glasser.RData")
- write_glasser_cifti(as.matrix(sex_t),colnames(sex_t),
- "../outputs/SexSA_UKBresults_Glasser.dscalar.nii")
- #use wb_view to load this cifit file: t_thresholded for Fig. S12a
- # compare effect size results from HCP and UKB for sex differences in sMRI
- sex_t_UKB <- sex_t
- load(file = "../data/SexSA_HCPresults_Glasser.RData")
- cor(sex_t$cohend,sex_t_UKB$cohend)
- # Fig S12b and source data
- spintest(sex_t$cohend,sex_t_UKB$cohend,'HCP_cohenD','UKB_cohenD',
- '../outputs/ROIbasedCorr_CohenD_MF_SA_HCP_UKB_MMPatlas_SpinTest10000.pdf',
- '../outputs/ROIbasedCorr_CohenD_MF_SA_HCP_UKB_MMPatlas_SpinTest10000.csv')
Script14_SexAnatomyUKB.R at commit 1788f03, no license · at the source
Overview
- Section on Developmental Neurogenomics, Human Genetics Branch, National Institute of Mental Health, Bethesda, MD USA
- Section on Cognitive Neuropsychology, Laboratory of Brain and Cognition, National Institute of Mental Health, Bethesda, MD USA
- Data Science and Sharing Team, National Institute of Mental Health, Bethesda, MD USA
Abstract
The neurobiological accompaniments of well-established sex differences in human behavior and disease remain unclear — in part due to a lack of large, diverse functional neuroimaging studies. We address this gap using over 700 h of fMRI data across seven tasks from 978 individuals with extensive structural and behavioral measures. We find that sex differences in task-activation are widespread (85% of cortex) and reproducible, largely task-specific, of small to moderate effect size, and unaligned with brain volume differences. While machine learning can classify sex from brain activation, volume, or behavior, these data types provide orthogonal information. Brain-wide association studies reveal that links between brain activation and behavior are highly conserved between sexes. The few subtle sex differences in brain-behavior linkage that do exist are not preferentially localized to sex-biased behaviors. Our findings clarify the nature of sex differences in human brain function and their links with neuroanatomy and behavior, providing a useful foundation for future research.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 22 matches between paragraphs and lines of code.
siyuanliu8/HCPsexdifferences
1788f03b6b649187bca9bd9bdc0359edb56be6a9, 13 May 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
47 files
- scripts/
Script10_readHCPsMRIdata , R, 162 lines, 1 match.R - scripts/
Script11_SexAnatomyHCP.R , R, 226 lines, 1 match - scripts/
Script12_CompareSexActiv , R, 670 linesationAnatomy.R - scripts/
Script13_readUKBsMRIdata , R, 99 lines, 2 matches.R - scripts/
Script14_SexAnatomyUKB.R , R, 304 lines, 3 matches - scripts/
Script15_SexBehavior.R , R, 233 lines, 1 match - scripts/
Script16_PredictSexActiv , R, 62 lines, 2 matchesation_TaskSpecificRegion .R - scripts/
Script17_PredictSexActiv , R, 88 linesation_TaskSpecificRegion _permutation.R - scripts/
Script18_PredictSexActiv , R, 63 linesation_TaskGeneralRegion. R - scripts/
Script19_PredictSexActiv , R, 84 linesation_TaskGeneralRegion_ permutation.R - scripts/
Script1_readHCPfMRIdata. , R, 251 linesR - scripts/
Script20_PredictSexActiv , R, 68 linesation_PerTaskSexDifferen ceRegion.R - scripts/
Script21_PredictSexActiv , R, 88 linesation_PerTaskSexDifferen ceRegion_Permutation.R - scripts/
Script22_PredictSexVolum , R, 115 linese_HCPmask.R - scripts/
Script23_PredictSexVolum , R, 152 linese_HCPmask_Permutation.R - scripts/
Script24_PredictSexSA_HC , R, 114 linesPmask.R - scripts/
Script25_PredictSexSA_HC , R, 152 linesPmask_Permutation.R - scripts/
Script26_PredictSexCT_HC , R, 114 linesPmask.R - scripts/
Script27_PredictSexCT_HC , R, 152 linesPmask_Permutation.R - scripts/
Script28_PredictSexBehav , R, 124 linesior.R - scripts/
Script29_PredictSexBehav , R, 160 lines, 1 matchior_Permutation.R - scripts/
Script2_ActivationPerTas , R, 147 linesk.R - scripts/
Script30_PredictSexVolum , R, 113 linese_UKBmask.R - scripts/
Script31_PredictSexVolum , R, 152 linese_UKBmask_Permutation.R - scripts/
Script32_PredictSexSA_UK , R, 116 linesBmask.R - scripts/
Script33_PredictSexSA_UK , R, 152 linesBmask_Permutation.R - scripts/
Script34_PredictSexCT_UK , R, 114 linesBmask.R - scripts/
Script35_PredictSexCT_UK , R, 152 linesBmask_Permutation.R - scripts/
Script36_PredictSex_Accu , R, 409 linesracyPlot.R - scripts/
Script37_PredictSex_STS. , R, 864 lines, 1 matchR - scripts/
Script38_BWAS_MaleSpecif , R, 110 linesic_ShufflingSubject.R - scripts/
Script39_BWAS_MaleSpecif , R, 67 linesic_ShufflingSex.R - scripts/
Script3_SexPerTask.R , R, 147 lines - scripts/
Script40_BWAS_FemaleSpec , R, 110 linesific_ShufflingSubject.R - scripts/
Script41_BWAS_FemaleSpec , R, 69 linesific_ShufflingSex.R - scripts/
Script42_BWAS_MaleFemale , R, 155 lines, 1 match_SplitHalf.R - scripts/
Script43_BWAS_SexSpecifi , R, 116 linesc_SignificantAssociation s.R - scripts/
Script44_BWAS_SexCompari , R, 388 lines, 3 matchesson.R - scripts/
Script45_BWAS_SexModulat , R, 114 linesion.R - scripts/
Script46_BWAS_SexModulat , R, 142 lines, 1 matchion_OmnibusDesnityPlot_R ankedDotPlot.R - scripts/
Script4_SexPerTask_Covar , R, 157 lines, 2 matchesy.R - scripts/
Script5_SexAcrossTasks.R , R, 206 lines, 1 match - scripts/
Script6_ClusteringTaskSp , R, 337 lines, 1 matchecificRegions.R - scripts/
Script7_TaskSpecificGene , R, 601 lines, 1 matchral_Enrichment.R - scripts/
Script8_TaskSpecific_Spl , R, 141 linesitHalf.R - scripts/
Script9_TaskGeneral_Spli , R, 133 linestHalf.R - README.md, Text, 59 lines
Code availability
All custom code and scripts used for data processing and statistical analysis in this study are publicly available on GitHub at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
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:
- 1 repository 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;
- 22 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
Datasets cited
- humanconnectome.org/
study/ , at Human Connectome Project; found in “Data availability”hcp-young-adult - ukbiobank.ac.uk/
enable-your-research/ , at UK Biobank; found in “Data availability”apply-for-access
Data availability
The primary HCP data are available by application at https://
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, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 8 authors, 2 keywords, 10 MeSH terms, 4 funders, 88 references.
Cite
This paper
Liu, S., Mahony, B. W., Whitman, E. T., Gotts, S. J., Moraczewski, D., Thomas, A., Martin, A., & Raznahan, A. (2026). Robust but independent sex differences in human brain function, structure, and behavior. Nature communications, 17(1), 6694. https://
BibTeX
@article{liu2026robust,
author = {Liu, Siyuan and Mahony, Bridget W and Whitman, Ethan T and Gotts, Stephen J and Moraczewski, Dustin and Thomas, Adam and Martin, Alex and Raznahan, Armin},
title = {{Robust but independent sex differences in human brain function, structure, and behavior}},
journal = {Nature communications},
year = {2026},
month = may,
volume = {17},
number = {1},
pages = {6694},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {42168179},
pmcid = {PMC13385741}
}
RIS
TY - JOUR
AU - Liu, Siyuan
AU - Mahony, Bridget W
AU - Whitman, Ethan T
AU - Gotts, Stephen J
AU - Moraczewski, Dustin
AU - Thomas, Adam
AU - Martin, Alex
AU - Raznahan, Armin
TI - Robust but independent sex differences in human brain function, structure, and behavior
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 6694
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Robust but independent sex differences in human brain function, structure, and behavior",
"container-title": "Nature communications",
"author": [
{
"family": "Liu",
"given": "Siyuan"
},
{
"family": "Mahony",
"given": "Bridget W"
},
{
"family": "Whitman",
"given": "Ethan T"
},
{
"family": "Gotts",
"given": "Stephen J"
},
{
"family": "Moraczewski",
"given": "Dustin"
},
{
"family": "Thomas",
"given": "Adam"
},
{
"family": "Martin",
"given": "Alex"
},
{
"family": "Raznahan",
"given": "Armin"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "6694",
"DOI": "10.1038/
"PMID": "42168179",
"PMCID": "PMC13385741",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
21
]
]
}
}
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.7554/elife.92200 [code]
- Comparative neuroimaging of sex differences in human and mouse brain anatomy.Journal: eLifeIn common: broom, car, lmerTest, 5 other tools, humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion, 14 references, 2 authors
- [2] doi:10.1038/s41467-024-52244-2
- A sex-stratified analysis of the genetic architecture of human brain anatomy.Journal: Nature communicationsIn common: ukbiobank.ac.uk/enable-your-research/apply-for-access, 14 references, 3 authors
- [3] doi:10.1038/s41467-026-74274-8 [code]
- Regional sex differences in human cortical anatomy vary in their morphometric bases and overlap with sex chromosomal and gonadal influences.Journal: Nature communicationsIn common: tidyverse, structural MRI / diffusion, 14 references, 2 authors
- [4] doi:10.1186/s13293-025-00728-1 [code]
- A cross-species analysis of neuroanatomical covariance sex differences in humans and mice.Journal: Biology of sex differencesIn common: broom, pheatmap, patchwork, 3 other tools, humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion, 10 references, author Armin Raznahan
- [5] doi:10.1186/s13293-022-00448-w
- Sex differences in the human brain: a roadmap for more careful analysis and interpretation of a biological reality.Journal: Biology of sex differencesIn common: structural MRI / diffusion, 10 references, author Armin Raznahan
- [6] doi:10.1038/s41467-024-45282-3 [code]
- Brain asymmetries from mid- to late life and hemispheric brain age.Journal: Nature communicationsIn common: easystats, car, lmerTest, 6 other tools, ukbiobank.ac.uk/enable-your-research/apply-for-access, structural MRI / diffusion, 3 references
- [7] doi:10.1038/s41593-024-01624-4 [code]
- Cortical gene expression architecture links healthy neurodevelopment to the imaging, transcriptomics and genetics of autism and schizophrenia.Journal: Nature neuroscienceIn common: limma, lmerTest, patchwork, 4 other tools, 5 references, author Armin Raznahan
- [8] doi:10.1002/hbm.26535 [code]
- How do tasks impact the reliability of fMRI functional connectivity?Journal: Human brain mappingIn common: lmerTest, lme4, patchwork, 4 other tools, 9 references
- [9] doi:10.1038/s41551-024-01242-2 [code]
- Contributions of network structure, chemoarchitecture and diagnostic categories to transitions between cognitive topographies.Journal: Nature biomedical engineeringIn common: Plotly, humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion, 11 references
- [10] doi:10.1162/imag.a.1420 [code]
- Substantial evidence against sex differences in bed nucleus of the stria terminalis volume in the human brain.Journal: Imaging neuroscience (Cambridge, Mass.)In common: easystats, patchwork, ggplot2, 1 other tool, humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion, 6 references
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: 1 repository of the authors' code, each at its verified commit and with its license, 46 scripts, and 22 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:84317bdc64a28da4…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41467-026-73262-2)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-73262-2.svg
:target: https://openscicode.org/badge/doi/10.1038/s41467-026-73262-2
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-73262-2"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-73262-2.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
