Routine pulmonary function testing forms a cornerstone of modern respiratory medicine, clinical trials, and epidemiological research, yet translating raw lung measurements into standardized clinical interpretations has historically required fragmented workflows and custom laboratory scripts. Researchers Patrick W. Johnson and Scott A. Helgeson have introduced pft, an open-source R software package designed to unify reference value calculations with the comprehensive interpretive algorithms established by major international respiratory societies. By bridging the gap between raw laboratory measurements and complex interpretive frameworks, the package enables research teams to analyze large patient cohorts, electronic health record databases, and clinical trial datasets without relying on closed proprietary platforms or ad hoc laboratory code.
Interpreting pulmonary function tests requires significantly more methodological rigor than applying arbitrary cutoff thresholds across isolated breathing maneuvers. Contemporary pulmonary workflows must identify and apply appropriate Global Lung Function Initiative reference equations, calculate predicted normal values and distributional boundaries, convert raw patient measurements into standardized z-scores, and systematically map those multi-parameter metrics into physiological patterns. The 2022 joint technical standard issued by the European Respiratory Society and the American Thoracic Society introduced substantial revisions to this interpretive architecture. The updated guidelines prioritized z-score-based evaluations over percentage-of-predicted ratios, established a formal five-way physiologic pattern classification, revised the criteria for evaluating bronchodilator responsiveness, and recognized preserved-ratio impaired spirometry as an explicit reportable phenotype. Until now, statistical packages in the open-source ecosystem addressed only fragmented pieces of this diagnostic progression, leaving cohort analysts without an integrated pipeline to execute the complete guideline sequence.
To establish a coherent analysis pipeline, pft implements an end-to-end framework organized across five distinct operational layers covering reference-equation modeling, routine interpretive logic, legacy comparison functions, specialized clinical extensions, and visualization tools. Developed as a pure-R package without compiled code or external binary dependencies, the software relies on a minimal runtime footprint consisting solely of the rlang and tibble packages. The architecture operates on a predictable data-frame in and data-frame out design pattern, in which computational functions append explicitly labeled result columns directly to the user’s input dataset rather than obscuring intermediate state or mutating source records. This deliberate transparent structure preserves all intermediate mathematical outputs, including age-predicted values, lower and upper limits of normal, z-scores, and percent-predicted metrics, thereby facilitating rigorous auditing, reproducible research workflows, and seamless integration with modern statistical libraries such as dplyr, broom, and targets.
The package integrates comprehensive reference-equation families covering the primary modalities of routine respiratory testing, including spirometry, static lung volumes, and gas transfer capacity. For spirometric evaluation, the package supports both the multi-ethnic GLI-2012 equations and the newer race-neutral GLI Global 2022 equations. A key architectural strength is that the selection of reference equations and the choice of interpretive guidelines operate as entirely independent arguments, permitting investigators to modify the reference population without altering the underlying diagnostic logic. For static lung volumes, the package implements the GLI-2021 equations, which were derived from 7,190 observations of individuals of European ancestry aged 5 to 80 years. Diffusion capacity is evaluated using the GLI-2017 equations for carbon monoxide transfer factor, incorporating the formal 2020 author correction. The software explicitly handles both traditional North American diffusing capacity units and European transfer factor SI units, requiring investigators to declare their chosen unit system via an explicit argument rather than guessing units from numeric scale.
At the center of the interpretive workflow is pft_classify, an automated diagnostic primitive that evaluates multi-modality measurements to assign patient records into five standardized physiologic categories: Normal, Non-specific, Obstructed, Restricted, or Mixed patterns. A classification of restriction strictly requires a preserved ratio of forced expiratory volume in one second to forced vital capacity alongside a total lung capacity below the lower limit of normal, and mixed defects similarly require verified total lung capacity impairment. When total lung capacity measurements are absent from the dataset, the package refuses to infer restriction from spirometry alone and instead flags preserved-ratio impaired spirometry as a distinct screening category. Downstream functions evaluate severity across four standardized z-score intervals spanning normal, mild, moderate, and severe physiologic impairment.
Beyond routine cross-sectional diagnostics, the package provides dedicated standalone helpers designed to accommodate specialized clinical inquiries and longitudinal monitoring. The bronchodilator evaluation function pft_bdr assesses airway reversibility according to the 2022 standard, which defines a positive response as a post-bronchodilator improvement exceeding 10 percent of the predicted baseline parameter for either forced expiratory volume or forced vital capacity. For serial patient assessments, the standalone helper pft_change calculates conditional-change z-scores based on paired longitudinal measurements, adjusting observed variations for within-subject biological variability and regression to the mean over defined elapsed intervals. Additional specialized tools evaluate the FEV1Q survival index proposed as an adult alternative for longitudinal risk stratification, apply hemoglobin corrections to carbon monoxide transfer measurements, compute the Global Initiative for Chronic Obstructive Lung Disease 2026 airflow-limitation grades, and calculate Graham 2019 spirometry session quality scores.
To guarantee that researchers can audit demographic and policy transitions, pft retains complete backward compatibility with earlier respiratory standards through dedicated legacy primitives. In an illustrative reclassification analysis evaluated within the paper, researchers processed a synthetic cohort of 200 patients under both the GLI-2012 race-adjusted equations and the GLI Global 2022 race-neutral equations while maintaining an identical 2022 interpretive framework. The demonstration revealed that five patients, representing 2.5 percent of the synthetic sample, shifted diagnostic categories across the Normal, Non-specific, Mixed, and Restricted boundaries, highlighting the software’s utility for isolating the clinical impact of shifting reference paradigms.
High-throughput computational efficiency was verified using extensive benchmarking protocols executed on simulated patient cohorts. In an evaluation comprising 100,000 synthetic patient records processed in a single serial R session on an AMD EPYC 9554P Linux host running R version 4.2.2, the core interpretation wrapper completed the full default diagnostic pipeline with a median elapsed time of 0.70 seconds across five repetitions, spanning a narrow range of 0.64 to 1.02 seconds. This processing performance corresponds to approximately 143,000 patient records per second, demonstrating that massive clinical research databases and multi-center electronic health record cohorts can be analyzed interactively without requiring high-performance computing clusters or parallel execution scaffolding. All benchmark scripts, reproducible protocol configurations, and session metadata are directly distributed within the package repository to ensure absolute transparency.
The mathematical and logical reliability of the package is anchored in a rigorous multi-tier verification framework containing 1,304 automated unit tests that achieve 99.0 percent code line coverage. Verification of the GLI-2012 reference equations was conducted against an external oracle consisting of a 1,000-row demographic grid obtained from the official Global Lung Function Initiative Network web calculator, confirming precision matches to three decimal places. The GLI Global 2022 spirometry algorithms were validated against the independent rspiro R package, verifying cross-implementation numerical agreement to within an absolute tolerance of 10 to the power of negative eight. Furthermore, all internal static lung volume and diffusion capacity coefficient tables underwent cell-by-cell audits against values printed in their original foundational publications, and the complete boundary logic of the interpretive classifiers was evaluated against synthetic edge-case grids designed to test every branch, cutoff limit, and missing-data condition.
While pft establishes a comprehensive analytical framework, the authors emphasize important operational boundaries and methodological limitations governing its deployment. The software is released under the permissive open-source MIT license and is intended exclusively for scientific research, clinical trials, and educational applications rather than as a certified medical device or a replacement for clinical review. The package does not perform raw flow-volume curve quality inspections, artifact identification, or automated biologic plausibility screening, leaving data cleaning, unit conformity, and demographic verification to the investigator. Furthermore, because static lung volume and gas transfer reference equations were derived primarily from cohorts of European descent, users must evaluate the appropriateness of these reference models when studying diverse populations. By centralizing international diagnostic criteria within an auditable, open-source R package, pft delivers a reproducible computational standard for the global respiratory research community.
Subject of Research: Open-source R package for pulmonary function test reference equations and diagnostic interpretation
Article Title: pft: An R package for reference values and interpretation of pulmonary function tests
Article References: Johnson, P. W., & Helgeson, S. A. (2026). pft: An R package for reference values and interpretation of pulmonary function tests. SoftwareX, 36, Article 103217. https://doi.org/10.1016/j.softx.2026.103217
Image Credits: AI Generated
DOI: 10.1016/j.softx.2026.103217
Keywords: pulmonary function tests, R package, spirometry, Global Lung Function Initiative, ERS ATS standards, diffusing capacity, static lung volumes, reproducible research, biostatistics, electronic health records, bronchodilator response, PRISm, respiratory physiology, open source software, clinical informatics, computational biology
Cite Scienmag News
Denise Maddox. (November 20, 2026). New Open Source R Package Automates Pulmonary Function Test Reference and Interpretation. Scienmag. https://scienmag.com/new-open-source-r-package-automates-pulmonary-function-test-reference-and-interpretation/
Denise Maddox. "New Open Source R Package Automates Pulmonary Function Test Reference and Interpretation." Scienmag, 20 November 2026, https://scienmag.com/new-open-source-r-package-automates-pulmonary-function-test-reference-and-interpretation/. Accessed 20 November 2026.
Denise Maddox. "New Open Source R Package Automates Pulmonary Function Test Reference and Interpretation." Scienmag. November 20, 2026. https://scienmag.com/new-open-source-r-package-automates-pulmonary-function-test-reference-and-interpretation/








