Skip to content

Add QST starter k - #62

Open
BriAnsari wants to merge 4 commits into
mainfrom
qst-starter-kit
Open

BriAnsari wants to merge 4 commits into
mainfrom
qst-starter-kit

Conversation

@BriAnsari

Copy link
Copy Markdown
Collaborator

No description provided.

github-actions Bot added a commit that referenced this pull request Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Preview: https://a2cps.github.io/starterkits/pr/62/

Rendered from d41be15. GitHub Pages takes a minute or so
to serve a new push, and the preview is removed when this pull request closes.

Add the skip-preview label to stop rebuilding it.

@psadil psadil linked an issue Aug 12, 2026 that may be closed by this pull request
github-actions Bot added a commit that referenced this pull request Aug 13, 2026

@psadil psadil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Please see some of the suggested edits.

Comment thread QST_starter_kit.qmd

Quantitative Sensory Testing (QST) is a set of standardized psychophysical assays that assess how pain is processed. In A2CPS, we use QST to characterize each participant's pain-processing "profile" before surgery, on the hypothesis that these profiles help predict who goes on to develop chronic post-surgical pain.

A2CPS collects three complementary QST assays, and each one is tested at both a surgical **index site** (near where surgery will occur, i.e., the knee for the TKA cohort and the chest for the thoracic cohort) and a **remote site** (the contralateral deltoid, which serves as a control location):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to have a citation for each of the measurements, if one exists. That could either look like a historical review paper, or even an "original" reference for the method. Here's one candidate:

McDaniel, A. L., Dimitrov, T. N., Bruehl, S. P., Monroe, T. B., Failla, M. D., Cowan, R. L., ... & Anderson, A. R. (2023). Psychophysics of pain: A methodological introduction. Pain Management Nursing, 24(4), 442-451.

Alternatively, is there something like a QST lecture that could be linked to?

Those kinds of links are especially helpful for people who have never worked with the data before.

Comment thread QST_starter_kit.qmd
- **Mechanical Temporal Summation (MTS)**: the increase in pain over a train of ten identical pokes delivered at 1 Hz with a Neuropen. MTS captures *pain facilitation*, i.e., the tendency of the central nervous system to amplify repeated input. **Higher MTS means greater facilitation.**
- **Conditioned Pain Modulation (CPM)**: the change in PPT after a conditioning cold-water hand immersion. CPM captures *descending inhibition*, i.e., the "pain inhibits pain" mechanism. **Negative CPM scores indicate that inhibition is present.**

For each assay, the cleaning workflow computes a **primary** and a **secondary** outcome, and for PPT and MTS these are reported at both the index and the remote site. The exact definitions follow the A2CPS Manual of Procedures:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "outcome," do you mean the same thing as "biomarker"? For example, some readers could be left wondering whether "Primary Outcome" and "Primary Biomarker" are the same thing.

Comment thread QST_starter_kit.qmd
|---|---|---|
| PPT | Mean PPT at the **index** site | Mean PPT at the **remote** site |
| MTS | Mean of 3 difference scores (Max minus initial) | Mean of 3 wind-up ratios, (Max + 1)/(initial + 1) |
| CPM | % change: (pre minus post)/pre × 100 | Difference: pre minus post |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these equations defined anywhere else? For example, in a publicly available data dictionary?

Comment thread QST_starter_kit.qmd
The files are plain CSVs, and here we use the [`tidyverse`](https://www.tidyverse.org/). We focus on the TKA cohort.

```{r setup}
library(tidyverse)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this to the top of the file? That'd be more consistent with the others. Also, in the other kits, we've loaded individual packages rather than pulling in the whole tidyverse.

```{r}
#| label: setup
library(dplyr)
library(ggplot2)
library(nio)
library(patchwork)
library(tidyr)
```

Comment thread QST_starter_kit.qmd

The eight derived biomarker columns for the TKA cohort follow a consistent naming scheme: `primary_` or `secondary_`, then the assay (`ppt`, `ts`, `cpm`), and for PPT and MTS the site (`index` or `remote`).

```{r peek}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you able to get prek working? That would apply some formatting and linting rules to harmonize the style. I have just now added a section to the contributing.md file about this: https://github.com/a2cps/starterkits?tab=contributing-ov-file#pre-commit-hooks

Comment thread QST_starter_kit.qmd
glimpse()
```

### Data Quality

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template was ambiguous, but there was meant to be a difference between Data Quality and Quality Control. It sounds like you're describing things that have already been done to the data, which I would take to mean Quality Control.

Comment thread QST_starter_kit.qmd

### Data Generation

QST is administered in person by trained study staff, following the A2CPS Manual of Procedures, which specifies the algometer and Neuropen procedures, the cold-water CPM protocol, the index and remote testing locations, and the double entry of every pain rating. Raw responses are captured in REDCap. The steps that turn the REDCap export into the reformatted files (filtering, deduplication, error checking, and computing the PPT, MTS, and CPM biomarkers) are documented in the cleaning workflow that comes with the release (`QSTCRF_data_quality_checks_and_reformat.html`).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can link directly to the rendered version of this document so people go straight to the appendix. See: https://quarto.org/docs/authoring/cross-references.html#sections.

Just a reminder for later: at a meeting earlier this week, we discussed updating the appendix to take the NDA download as input and produce data in the format expected by this QST starter kit. You can link directly

Comment thread QST_starter_kit.qmd

- **Directionality matters.** Higher PPT means less sensitivity, higher MTS means more facilitation, and negative CPM points to inhibition. A flipped sign quietly reverses a result, so the table above is a handy reference.
- **MTS and WUR are non-negative by construction.** The difference and wind-up scores use `max(final, initial)` in place of the recorded maximum, so they never fall below 0 (difference) or 1 (wind-up ratio). This includes a handful of records where the recorded maximum was below the initial rating, but it is worth knowing when reproducing the values.
- **Cohort-specific field names.** The TKA and thoracic files use different underlying REDCap field names (for example, the double-entry suffixes differ), and the thoracic cohort also includes a Dynamic Mechanical Allodynia assessment. The biomarker columns are harmonized across cohorts, so they tend to be the easier starting point when comparing the two.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many readers won't know how REDCap relates to the data. I'd replace REDCap for "raw," or maybe "raw (REDCap exported)"

Comment thread QST_starter_kit.qmd
- **Directionality matters.** Higher PPT means less sensitivity, higher MTS means more facilitation, and negative CPM points to inhibition. A flipped sign quietly reverses a result, so the table above is a handy reference.
- **MTS and WUR are non-negative by construction.** The difference and wind-up scores use `max(final, initial)` in place of the recorded maximum, so they never fall below 0 (difference) or 1 (wind-up ratio). This includes a handful of records where the recorded maximum was below the initial rating, but it is worth knowing when reproducing the values.
- **Cohort-specific field names.** The TKA and thoracic files use different underlying REDCap field names (for example, the double-entry suffixes differ), and the thoracic cohort also includes a Dynamic Mechanical Allodynia assessment. The biomarker columns are harmonized across cohorts, so they tend to be the easier starting point when comparing the two.
- **Quality control.** The biomarker code has been reviewed and independently derived from the raw pain ratings, and the error report shows which records were flagged during cleaning.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is true, it may leave readers wondering what you mean by "review" and "flagging," specifically. What about linking to your preprint for the app?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New kit: QST

2 participants