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
Explore details

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.

mass_spec.xlsmExcel / VBA

Start with the instrument export

Read feature intensities across sample runs.

Start with the instrument export. Illustrative values.
1FeatureA2B1A1B3A3B2
2F01867,615177,066888,664193,138992,223122,251
3F022,553,5071,540,3911,453,7051,766,3711,328,2121,825,036
4F03631,944477,146668,575455,352645,305454,432
5F04211,311202,711229,028217,331195,032155,869
6F05445,089328,160371,131308,204404,021310,824
7F06578,980553,005535,519587,767673,217621,816
8F07228,668202,615179,397184,196167,590154,326
9F08615,739166,781500,726186,353438,788174,013

Scroll sideways for more columns.

Intensity by run. Compare the sample names across the columns.

mass_spec.xlsmExcel / VBA

Put the sample columns in order

Keep one feature per row; place each group’s samples together.

Put the sample columns in order. Illustrative values.
1FeatureA1A2A3B1B2B3
2F01888,664867,615992,223177,066122,251193,138
3F021,453,7052,553,5071,328,2121,540,3911,825,0361,766,371
4F03668,575631,944645,305477,146454,432455,352
5F04229,028211,311195,032202,711155,869217,331
6F05371,131445,089404,021328,160310,824308,204
7F06535,519578,980673,217553,005621,816587,767
8F07179,397228,668167,590202,615154,326184,196
9F08500,726615,739438,788166,781174,013186,353

Scroll sideways for more columns.

Group A: A1, A2, A3Group B: B1, B2, B3
mass_spec.xlsmExcel / VBA

Flag cells for review

Mark a missing intensity before comparing groups.

Flag cells for review. Illustrative values.
1FeatureA2Review
2F01PresentComplete
3F02MissingCheck A2
4F03PresentComplete
5F04PresentComplete

Scroll sideways for more columns.

This missing cell demonstrates a flag. The statistics below use the complete illustrative table.

mass_spec.xlsmExcel / VBA

Calculate the comparison

Fill down group means, fold changes and t-test p-values.

Calculate the comparison. Illustrative values.
1FeatureMean AMean BLog2 changep-value
2F0119.8017.30-2.510.00379
3F0220.7020.700.000.992
4F0319.3118.82-0.490.000123
5F0417.6917.54-0.150.416
6F0518.6318.27-0.360.0291
7F0619.1819.16-0.020.896
8F0717.5417.45-0.090.658
9F0818.9717.42-1.550.00460

Scroll sideways for more columns.

For this example: means of log2 intensities, B minus A, and a two-sided Welch t-test.

mass_spec.xlsmExcel / VBA

Inspect the volcano plot

Compare the size of each change with its p-value.

−log10(p-value) ↑ smaller p-value

0246-303F01: log2 fold change -2.51; p-value 0.00379F02: log2 fold change 0.00; p-value 0.992F03: log2 fold change -0.49; p-value 0.000123F04: log2 fold change -0.15; p-value 0.416F05: log2 fold change -0.36; p-value 0.0291F06: log2 fold change -0.02; p-value 0.896F07: log2 fold change -0.09; p-value 0.658F08: log2 fold change -1.55; p-value 0.00460F09: log2 fold change -0.32; p-value 0.479F10: log2 fold change 0.03; p-value 0.878F11: log2 fold change -0.30; p-value 0.118F12: log2 fold change 0.07; p-value 0.484F13: log2 fold change 0.33; p-value 0.0127F14: log2 fold change 0.05; p-value 0.861F15: log2 fold change -1.87; p-value 0.00576F16: log2 fold change 0.18; p-value 0.358F17: log2 fold change -0.35; p-value 0.108F18: log2 fold change -0.18; p-value 0.182F19: log2 fold change -0.12; p-value 0.279F20: log2 fold change -0.35; p-value 0.0624F21: log2 fold change -0.24; p-value 0.261F22: log2 fold change 2.93; p-value 0.0000278F23: log2 fold change 0.46; p-value 0.0605F24: log2 fold change 0.19; p-value 0.360F25: log2 fold change 0.33; p-value 0.111F26: log2 fold change -0.10; p-value 0.311F27: log2 fold change -0.04; p-value 0.896F28: log2 fold change -0.05; p-value 0.658F29: log2 fold change 1.38; p-value 0.00257F30: log2 fold change -0.08; p-value 0.440F31: log2 fold change 0.82; p-value 0.00113F32: log2 fold change -0.08; p-value 0.277F33: log2 fold change 0.14; p-value 0.471F34: log2 fold change 0.18; p-value 0.259F35: log2 fold change -0.02; p-value 0.851F36: log2 fold change -2.31; p-value 0.00111F37: log2 fold change -0.32; p-value 0.285F38: log2 fold change -0.18; p-value 0.592F39: log2 fold change -0.35; p-value 0.0410F40: log2 fold change 0.25; p-value 0.409F41: log2 fold change -0.34; p-value 0.0550F42: log2 fold change -0.17; p-value 0.227F43: log2 fold change -2.02; p-value 0.000710F44: log2 fold change 0.66; p-value 0.0929F45: log2 fold change -0.29; p-value 0.0741F46: log2 fold change -0.65; p-value 0.0274F47: log2 fold change -0.17; p-value 0.0927F48: log2 fold change 0.42; p-value 0.0438F49: log2 fold change 0.10; p-value 0.639F50: log2 fold change 0.84; p-value 0.00213F51: log2 fold change -0.46; p-value 0.145F52: log2 fold change -0.63; p-value 0.0460F53: log2 fold change -0.06; p-value 0.850F54: log2 fold change -0.44; p-value 0.208F55: log2 fold change 0.14; p-value 0.695F56: log2 fold change -0.26; p-value 0.293
Log2 fold change (B / A)
Lower in BBelow cut-offsHigher in B

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
mass_spec.xlsmExcel / VBA

Where it was used

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