Mass-spec macro
An Excel/VBA macro turns raw high-resolution mass-spec exports into tidy tables, t-tests and volcano plots. I wrote the macro, ran samples, and operated and calibrated a Thermo Fisher Velos Pro mass spectrometer. I used it mainly for human samples. It also supported samples from the same mouse study as the Flex v2 work.
- Tools
- Excel and VBA
- Instrument
- Thermo Fisher Velos Pro
- Output
- Tidy tables, t-tests and volcano plots
Mass-spec macro
I wrote an Excel/VBA pipeline that reshapes mass-spec exports, runs t-tests and draws volcano plots for lab review.
Scroll through the workbook, or select Run macro to advance a step.
Illustrative data throughout. The macro source and study data are private; the lab’s cleaning rules are not shown.
Read feature intensities across sample runs.
| 1 | Feature | A2 | B1 | A1 | B3 | A3 | B2 |
|---|---|---|---|---|---|---|---|
| 2 | F01 | 867,615 | 177,066 | 888,664 | 193,138 | 992,223 | 122,251 |
| 3 | F02 | 2,553,507 | 1,540,391 | 1,453,705 | 1,766,371 | 1,328,212 | 1,825,036 |
| 4 | F03 | 631,944 | 477,146 | 668,575 | 455,352 | 645,305 | 454,432 |
| 5 | F04 | 211,311 | 202,711 | 229,028 | 217,331 | 195,032 | 155,869 |
| 6 | F05 | 445,089 | 328,160 | 371,131 | 308,204 | 404,021 | 310,824 |
| 7 | F06 | 578,980 | 553,005 | 535,519 | 587,767 | 673,217 | 621,816 |
| 8 | F07 | 228,668 | 202,615 | 179,397 | 184,196 | 167,590 | 154,326 |
| 9 | F08 | 615,739 | 166,781 | 500,726 | 186,353 | 438,788 | 174,013 |
Scroll sideways for more columns.
Intensity by run. Compare the sample names across the columns.
Keep one feature per row; place each group’s samples together.
| 1 | Feature | A1 | A2 | A3 | B1 | B2 | B3 |
|---|---|---|---|---|---|---|---|
| 2 | F01 | 888,664 | 867,615 | 992,223 | 177,066 | 122,251 | 193,138 |
| 3 | F02 | 1,453,705 | 2,553,507 | 1,328,212 | 1,540,391 | 1,825,036 | 1,766,371 |
| 4 | F03 | 668,575 | 631,944 | 645,305 | 477,146 | 454,432 | 455,352 |
| 5 | F04 | 229,028 | 211,311 | 195,032 | 202,711 | 155,869 | 217,331 |
| 6 | F05 | 371,131 | 445,089 | 404,021 | 328,160 | 310,824 | 308,204 |
| 7 | F06 | 535,519 | 578,980 | 673,217 | 553,005 | 621,816 | 587,767 |
| 8 | F07 | 179,397 | 228,668 | 167,590 | 202,615 | 154,326 | 184,196 |
| 9 | F08 | 500,726 | 615,739 | 438,788 | 166,781 | 174,013 | 186,353 |
Scroll sideways for more columns.
Mark a missing intensity before comparing groups.
| 1 | Feature | A2 | Review |
|---|---|---|---|
| 2 | F01 | Present | Complete |
| 3 | F02 | Missing | Check A2 |
| 4 | F03 | Present | Complete |
| 5 | F04 | Present | Complete |
Scroll sideways for more columns.
This missing cell demonstrates a flag. The statistics below use the complete illustrative table.
Fill down group means, fold changes and t-test p-values.
| 1 | Feature | Mean A | Mean B | Log2 change | p-value |
|---|---|---|---|---|---|
| 2 | F01 | 19.80 | 17.30 | -2.51 | 0.00379 |
| 3 | F02 | 20.70 | 20.70 | 0.00 | 0.992 |
| 4 | F03 | 19.31 | 18.82 | -0.49 | 0.000123 |
| 5 | F04 | 17.69 | 17.54 | -0.15 | 0.416 |
| 6 | F05 | 18.63 | 18.27 | -0.36 | 0.0291 |
| 7 | F06 | 19.18 | 19.16 | -0.02 | 0.896 |
| 8 | F07 | 17.54 | 17.45 | -0.09 | 0.658 |
| 9 | F08 | 18.97 | 17.42 | -1.55 | 0.00460 |
Scroll sideways for more columns.
For this example: means of log2 intensities, B minus A, and a two-sided Welch t-test.
Compare the size of each change with its p-value.
−log10(p-value) ↑ smaller p-value
Feature readout
Hover or focus a point. Use Up and Down to move between features.
- Feature
- F01
- Log2 change
- -2.51
- p-value
- 0.00379
I used the macro for human samples and the mouse study.
Mainly human samples
Also the mouse study
I wrote the macro so a bench scientist could review results without hand-formatting the export.
I operated, maintained and calibrated the Thermo Fisher Velos Pro.
Cincinnati Children’s Research Foundation · Research Student II · Aug 2025 to May 2026.
Evidence ledger