library(arrow)
library(dplyr)
library(tidyr)21 Prior Neural Pain Signature Responses
A “neural signature” is a multivariate pattern of brain activity that has been statistically optimized to predict a specific mental state or symptom—in this case, pain. Rather than looking at activity in a single brain region, these signatures use predefined weight maps across the whole brain. By calculating the dot product (or spatial correlation) between a participant’s fMRI scan and these established weight maps, we can estimate a single scalar response value that reflects how strongly the participant’s brain activity matches the signature. Two prominent examples used in A2CPS are the Neurologic Pain Signature (NPS) and the Signature of Intact Nociception and Pain (SIIPS1).
21.1 Starting Project
21.1.1 Locate data
On TACC, the data are stored underneath the releases. For example, data release v2.1.0 is underneath
/corral-secure/projects/A2CPS/products/consortium-data/pre-surgery-release-2-1-0Paths in this kit are written relative to that release folder, so the neuroimaging data are underneath mris.
The signature response are underneath derivatives/signatures
$ ls mris/derivatives/signatures/
cleaned confounds.json signatures-by-part-diff signatures-by-part.json signatures-by-run-diff signatures-by-run.json signatures-by-tr-diff signatures-by-tr.json
confounds signatures-by-part signatures-by-part-diff.json signatures-by-run signatures-by-run-diff.json signatures-by-tr signatures-by-tr-diff.jsonSignature responses are stored either “by-run” (that is, one response per scan), “by-part” (three responses per run corresponding to the three parts for which participants provided pain ratings), or “by-tr” (one response for every volume). The biomarker corresponds to the values that are “by-run”. Additionally, responses may be calculated with only the data from a single run (e.g., a “by-run” response for REST1, CUFF1, CUFF2, and REST2), or they may be calculated as a difference (“diff”) between one of the CUFF scans and one of the REST scans.
Each signature response folder contains a table of values, and *.json sidecars are data dictionaries that conform to BIDS. The data dictionary for responses “by-run” is copied below.
{
"signature": {
"LongName": "Signature",
"Description": "Index for of Signature. See signature_labels.json"
},
"correlation": {
"LongName": "Correlation",
"Description": "Signature as Estimated by Correlation"
},
"dot": {
"LongName": "Dot Product",
"Description": "Signature as Estimated by Dot Product"
},
"cosine": {
"LongName": "Cosine Similarity",
"Description": "Signature as Estimated by Cosine Similarity"
},
"sub": {
"LongName": "Subject",
"Description": "Study Participant, BIDS Subject ID",
"TermURL": "https://bids-specification.readthedocs.io/en/v1.9.0/appendices/entities.html#sub"
},
"ses": {
"LongName": "Session",
"Description": "Visit, Protocol, BIDS Session ID",
"Levels": {
"V1": "baseline_visit",
"V3": "3mo_postop"
},
"TermURL": "https://bids-specification.readthedocs.io/en/v1.9.0/appendices/entities.html#ses"
},
"task": {
"LongName": "Task",
"Description": "Functional MRI Task, BIDS Task ID",
"Levels": {
"cuff": "cuff pressure scan",
"rest": "resting state scan"
},
"TermURL": "https://bids-specification.readthedocs.io/en/v1.9.0/appendices/entities.html#task"
},
"run": {
"LongName": "Run",
"Description": "Task Run Number, BIDS Run ID",
"TermURL": "https://bids-specification.readthedocs.io/en/v1.9.0/appendices/entities.html#run"
}
}Note: the table mentions “session”, but in this release only V1 (baseline) results are available.
21.1.2 Extract data
The tabular data comprise parquet files that have been partitioned in a hive-style. That is, subfolder names contain column information – in this case subject ID (REDCap Record ID), task, and run.
$ tree signature-by-run
signature-by-run
├── sub=10003
│ └── ses=V1
│ ├── task=cuff
│ │ └── run=1
│ │ └── part-0.parquet
│ └── task=rest
│ ├── run=1
│ │ └── part-0.parquet
│ └── run=2
│ └── part-0.parquet
├── sub=10008
│ └── ses=V1
│ ├── task=cuff
│ │ └── run=1
│ │ └── part-0.parquet
│ └── task=rest
│ ├── run=1
│ │ └── part-0.parquet
│ └── run=2The biomarker is based on the CUFF1 (task=cuff/run=1) scan. The other scans are available for secondary analyses, but please note that not all participants have all tasks and runs available.
To load the whole dataset, the parquet files may be read individually or using a tool that is aware of the hive-partitioning structure. In R, a good choice is the arrow library.
open_dataset(
"data/pre-surgery/mris/derivatives/signatures/signatures-by-run"
) |>
filter(signature %in% c("grouppred_cvpcr", "137subjmap_weighted_mean")) |>
filter(task == "cuff", run == 1) |>
select(signature, value = correlation, sub, ses) |>
collect() |>
pivot_wider(names_from = signature) |>
rename(SIIPS1 = `137subjmap_weighted_mean`, NPS = `grouppred_cvpcr`)# A tibble: 712 × 4
sub ses NPS SIIPS1
<int> <chr> <dbl> <dbl>
1 10010 V1 -0.0200 -0.0611
2 10003 V1 0.0331 -0.00162
3 10008 V1 -0.0581 -0.0407
4 10011 V1 -0.0740 -0.00652
5 10013 V1 0.0234 -0.0279
6 10014 V1 -0.0146 -0.00120
7 10015 V1 -0.0178 -0.0576
8 10017 V1 0.0263 -0.0165
9 10020 V1 -0.0530 -0.0103
10 10023 V1 -0.00789 0.0116
# ℹ 702 more rows
21.2 Considerations While Working on the Project
21.2.1 Variability Across Scanners
Many MRI biomarkers exhibit variability across the scanners, which may confound some analyses. For an up-to-date assessment of the issue and overview of current thinking, please see Appendix D.
21.2.2 Data Quality
As with any MRI derivative, all pipeline derivatives have been included. This means that products were included regardless of their quality, and so some products may have been generated from images that are known to have poor quality—rated “red”, or incomparable. For details on the ratings and how to exclude them, see Appendix A. Additionally, extensive QC has not yet been performed on the derivatives themselves, and so there may be cases where pipelines produced atypical outputs. For an overview of planned checks, see Confluence.
21.2.3 Signature Response Measure
The signature responses were extracted using best-practices, but the imaging DIRC is currently exploring alternative ways of calculating signature responses in the CUFF tasks.
21.2.4 Intermediate Outputs
The other folders contain intermediate outputs that may be useful for digging into a participant’s results
- confounds
- The nuisance timeseries that were used during denoising
- cleaned
- The NifTI files of functional MRI after denoising (e.g., temporal filter, nuisance regression)
21.3 Citations
In publications or presentations including data from A2CPS, please include the following statement as attribution:
Data were provided (in part) by the A2CPS Consortium funded by the National Institutes of Health (NIH) Common Fund, which is managed by the Office of the Director (OD)/Office of Strategic Coordination (OSC). Consortium components and their associated funding sources include Clinical Coordinating Center (U24NS112873), Data Integration and Resource Center (U54DA049110), Omics Data Generation Centers (U54DA049116, U54DA049115, U54DA049113), Multi-site Clinical Center 1 (MCC1) (UM1NS112874), and Multi-site Clinical Center 2 (MCC2) (UM1NS118922).
When using neuroimaging derivatives, please also cite Sadil et al. (2024).