Introduction
Tuberculosis (TB) remains a major global public health problem. In 2024, the World Health Organization estimated that 10.8 million people worldwide had TB (95% uncertainty interval (UI): 10.1–11.7 million) and 1.25 million of them died of this disease through 2023 [1]. Tuberculous pleural effusion (TPE) is the second most prevalent manifestation of extrapulmonary TB, just after tuberculous lymphadenitis [2]. Additionally, TPE constitutes a paucibacillary manifestation of tuberculous disease, and the usefulness of various biomarkers in pleural fluid has been extensively analysed. The most promising biomarker is adenosine deaminase (ADA), as the measurement of this enzyme is cheap, easy and available in most laboratories, and it has shown uniformly high diagnostic performance through five consecutive meta-analyses with a mean sensitivity and specificity of 92–93% and 90–92% respectively, for a diagnostic cut-off point of 40 U/l [3–7].
The approach for diagnosing incident cases has traditionally been determined by the regional variation in overall TPE prevalence [8]; in relation to this, based on a Bayesian interpretation of its diagnostic accuracy, ADA in pleural fluid is considered optimal as a rule-in test in high TB prevalence settings and as a rule-out test in low prevalence scenarios [9,10]. More recently, Shaw et al. proposed an ADA level greater than 40 U/L for ruling in TPE diagnosis with a local TB global incidence of over 125 cases per 100,000 population, and ADA less than 30 U/L for ruling out TPE in low-incidence countries [11].
The progressively wider use of machine learning (ML) tools in medicine is providing researchers with new opportunities to improve diagnostic accuracy by including additional biomarkers. In 2021, our group published a comparison of different ML algorithms for the diagnosis of TPE in a low prevalence scenario (3.8%) based on 230 exudative and lymphocytic pleural effusions diagnosed in Gipuzkoa Region from 2013 to 2020 [12]. The variables included in the predictive models were age, ADA and results from the routine analysis of pleural fluid including cell counts and biochemical tests. The best ML algorithm (support vector classifier, SVC, a particular type of support vector machine) achieved a sensitivity and specificity of 91% and 98% respectively; furthermore, compared with the Bayesian analysis of ADA level > 40 U/l plus lymphocyte percentage ≥ 50% in pleural fluid, the positive predictive value (PPV) increased from 42.4% to 70.5% in a 5% pre-test probability scenario. As the presumptive diagnosis of TPE has been traditionally driven by its prevalence, we needed to confirm that the implemented tool maintains its diagnostic properties in other scenarios featuring a different tuberculous prevalence.
The aim of this study was to perform an external validation of the aforementioned model by testing the trained ML algorithm in a different TPE prevalence setting, namely 360 pleural exudative and lymphocytic pleural effusions diagnosed in Bajo Deba Health District from 1996 to 2012. In a second step, we compared the diagnostic accuracy of the ML procedure and the classical Bayesian analysis system for TPE in both different clinical scenarios (Bajo Deba 1996–2012 and Gipuzkoa 2013–2022).
Materials and methods
We pooled data from two groups of patients from Gipuzkoa (Basque Country, Spain) from January 1996 to the present. All the patients had been diagnosed with pleural effusion, undergone diagnostic thoracentesis, and had ADA level measured in the pleural fluid sample obtained. The first group, with which the ML models were trained (Training group), corresponded to patients from the whole region of Gipuzkoa, included in a previously published article regarding the diagnostic accuracy of ML for TPE [12], and for whom data were collected from January 2013 to December 2020. We extended this group with patients prospectively recruited across the region until December 2022. The second group, with which the ML models were tested (Testing group), comprised a retrospective cohort of patients from a specific area (Bajo Deba health district) for whom data were collected from January 1996 to December 2012 (partial results from 1998 to 2008 were published in 2012) [13]. The retrospective project counted with the permission of the local Ethics Committee of the Mendaro Hospital and the approval of the Western Gipuzkoa Clinical Research Commission; in the prospective project all patients gave written informed consent (the parents of a seventeen years old girl signed the unique informed consent for a minor) and the protocol was evaluated and approved by the Clinical Research Ethics Committee of Gipuzkoa (Record number 11/12). Data were accessed for research purposes from September to December 2012 within the retrospective project and from March 2013 to December 2022 for the prospective one.
The mean annual incidence rates of TB in Gipuzkoa from 2013 to 2022 and in Bajo Deba health district from 1996 to 2012 and in were 12.59 and 43.17 cases per 100,000 population respectively. Although a Tuberculosis Control Programme was not implemented in the Basque Country until 2003 [14], data recording has been highly reliable since 1995.
The following variables were included: age, pleural fluid ADA level, and pleural fluid routine test results: pH, glucose, protein, and lactate dehydrogenase (LDH) levels, and white blood cell counts (total and differential). It was not possible to include the red blood cell count in the analysis since it had not been routinely assessed in the referral hospital of Bajo Deba health district during the specified period (1996–2012). Further, to ensure consistency with the methodology employed in the 2013–2022 Gipuzkoa study, we considered only the first pleural fluid sample from each case. The databases were anonymized and authors did not have access to information that could identify individual participants.
Diagnostic criteria for tuberculous, malignant and parapneumonic pleural effusion applied to all the cases from the external validation/Testing group were as follows [15,16]:
* Confirmed tuberculous pleural effusion: positive culture or Xpert MTB/RIF assay in pleural fluid, pleural tissue or sputum.
* Probable tuberculous pleural effusion: granulomatous inflammation in pleural tissue and/or exudative and lymphocytic pleural effusion with ADA > 40 U/l and complete recovery with antituberculosis treatment.
* Confirmed malignant pleural effusion: malignant cells found in pleural biopsy tissue or pleural fluid.
* Paramalignant pleural effusion: cancer diagnosed de novo, no other cause of pleural effusion identified, absence of malignant cells in pleural fluid and pleural biopsy tissue, and parallel evolution of malignant disease and pleural effusion.
* Parapneumonic effusion: alveolar consolidation diagnosed by chest X-ray or computed tomography with ipsilateral pleural effusion, and total recovery of both with antibiotic treatment.
The rest of the cases in this group were diagnosed by well-defined clinical criteria, and all the cases in the Training group had gold standard quality diagnoses [12].
Overall, in the Training group (Gipuzkoa 2013–2022), 273 pleural effusions were exudative and lymphocytic and, of these, 49 were of tuberculous origin and 143 malignant. Regarding, the Testing group (Bajo Deba 1996–2012), 360 out of 832 episodes of pleural effusion were exudative and lymphocytic, and TB was diagnosed in 104 out of these 360 cases. Additionally, 92 cases were found to have a malignant aetiology.
The sample size for the Training group was computed by using a statistical program (Epidat 3.1). For a sensitivity of 95%, specificity of 90%, prevalence (pre-test probability) of 10%, significance level of 5%, power of 80%, and precision of 5%, the minimum sample size was 200 pleural effusions (12). Regarding the Testing group, we tried to include as many pleural effusions as possible due to the fact that the data recording was retrospective; we were able to record reliable data from 1996 to 2012.
In line with previous studies on pleural diseases since the 1990s, the term “prevalence” was employed to refer to the number of cases of a specific type of pleural effusion divided by the total number of pleural effusions studied in a given clinical setting over a known period of time. In this context, “prevalence” can be considered a synonym of “pre-test probability”. Nonetheless, it should be noted that the term “pre-test probability” for ML specifically refers to the number of pleural fluid samples with a given diagnosis divided by the number of pleural fluid samples included in the study, not in the clinical scenario. Table 1 reports both of these variables; additionally, Supporting information (S1 Table and S2 Table) list the aetiology and diagnostic criteria met for all the cases included in the study.
[Figure omitted. See PDF.]
Age and pleural fluid ADA level were by far the most relevant variables in our reference study (Training Group), and therefore, we compared the two populations as a function of these two variables and in a categorical way. Results of these comparisons are presented in Table 2.
[Figure omitted. See PDF.]
As we can see, “age” and “ADA level” show similar values and behaviour in the two groups. The only statistically significant difference was found in the age of the two populations diagnosed with TPE: they were younger in the external validation or Testing group (Bajo Deba 1996–2012), and this is attributable to the TB incidence in the corresponding period being higher than in the Training group (Gipuzkoa 2013–2022), implying more TB bacilli circulating in the community and in turn a higher proportion of primary infections like cases of TPE in young people [17,18].
Along with this, Fig 1 shows the distribution of “tuberculous” and “others” samples as a function of ADA and age in both Training and Testing groups (recalling that all pleural fluid samples are exudative and lymphocytic, and hence, this distribution is the result of combining the two variables ADA > 40 U/l and lymphocyte percentage ≥ 50%: ADA 40 + LP 50). In this figure, there is a horizontal line representing the ADA level = 40 U/l. We can conclude that patients in both Training and Testing groups were evenly distributed, and hence, a comparison between them is valid.
[Figure omitted. See PDF.]
Two distinct analyses were conducted. The primary analysis employed ML techniques to categorize samples into two groups: tuberculous and non-tuberculous. A secondary analysis utilized the same techniques to further differentiate malignant cases, resulting in three categories: tuberculous, malignant, and “others”. During both the training and testing phases, the following variables were used: age, pleural fluid ADA level, and routine parameters derived from pleural fluid analysis (including pH, glucose, protein, and LDH levels, and total and differential white blood cell counts). In this study, the six classifiers employed were the same as those used in the previous study, and are among the most widely used types of ML classifier: multilayer perceptron, logistic regression, SVC, decision tree, K-nearest neighbours, and random forest. As in our previous study, we utilized the Python scikit-learn library to implement these classifiers. For each classifier, we explored a range of parameter values in conjunction with a 5-fold cross-validation approach.
Additionally, we compared positive and negative predictive values as a function of pre-test probability for the different trained ML models, as well as for a classification based on the ADA 40 + LP 50 criterion. The estimated positive predictive value (PPV) was calculated as a function of the pre-test probability (prevalence) using the sensitivity and specificity of each classifier obtained in the training dataset (Gipuzkoa):
The real PPVs in Gipuzkoa and Bajo Deba were calculated as the true positives divided by the sum of the true positives and false positives, obtained in each dataset:
Finally, we performed a three-class classification: tuberculous, malignant and others for comparability with our previous study.
Results
Fig 2 shows the confusion matrices of the cross-validation results for all the ML models in the training set (Gipuzkoa), and the testing results (Bajo Deba) (0: others, 1: tuberculous; predicted values in columns, real values in rows).
[Figure omitted. See PDF.]
Besides the classification results obtained with the ML models, we also conducted the same classification using the ADA 40 + LP 50 criterion to classify a sample as tuberculous. Using this criterion, we classified 210 cases of non-tuberculous disease as non-tuberculous (true negatives, TNs), 47 cases of TB as tuberculous (true positives, TPs), 14 cases of non-tuberculous disease as tuberculous (false positives, FPs) and 2 cases of TB as non-tuberculous disease (false negatives, FNs) in the Gipuzkoa dataset. On the other hand, in the Bajo Deba dataset, we obtained 248 TNs, 96 TPs, 8 FPs and 8 FNs.
Table 3 lists the metrics of accuracy, sensitivity, specificity, and PPV for each dataset for the different trained ML models and the ADA 40 + LP 50 criterion.
[Figure omitted. See PDF.]
In Fig 3, the comparison of positive and negative predictive values as a function of pre-test probability is shown for the different trained ML models, as well as for a classification based on the ADA 40 + LP 50 criterion. The dashed vertical lines indicate the ML TPE pre-test probability points for the training (0.18) and testing (0.29) datasets (recall that the corresponding clinical scenario pre-test probabilities or “local prevalence of TPE” are 4% and 12.5% respectively).
[Figure omitted. See PDF.]
Table 4 compares the real and estimated PPVs obtained for each ML model as well as for a classification based on ADA 40 + LP 50, at the particular pre-test probabilities in the training (Gipuzkoa: 0.18) and testing (Bajo Deba: 0.29) datasets.
[Figure omitted. See PDF.]
It can be observed that the PPV from the ML models exceeds that based on the ADA 40 + LP 50 criterion in several cases, both for the Gipuzkoa and Bajo Deba datasets. Additionally, the estimated PPVs underestimate the real values obtained in the Bajo Deba dataset for all ML models as well as for the ADA 40 + LP 50-based classifier.
Fig 4 shows the confusion matrices of the classification results in Gipuzkoa (left) and Bajo Deba (right), respectively (0: tuberculous, 1: malignant, and 2: others; predicted values in columns, real values in rows).
[Figure omitted. See PDF.]
Discussion
In this study, we have performed an external validation of our results from a prospective study that assessed the usefulness of ML for predicting the diagnosis of TPE, going beyond the ADA 40 + LP 50 criterion, in a low prevalence setting and through the period 2013–2022 [12]. We decided to conduct the study in a different prevalence scenario and we found some additional interesting behaviours of the ML classifiers in this context.
TPE constitutes a type 4 hypersensitivity reaction to mycobacterial antigens, and it is not certain whether this immunogenic response needs live mycobacteria. There is a well-proven initial invasion of polymorphonuclear leukocytes in the pleural fluid, followed by macrophages, and finally, almost all TPE fluids become lymphocytic [19,20]. An ideal diagnostic tool to confirm TPE should be able to detect Mycobacterium tuberculosis or any of its specific subunits or components directly, and optimally in pleural fluid through diagnostic thoracentesis; but due to its paucibacillary nature, current microbiological and nucleic acid amplification tests show low sensitivity: < 5% with acid-fast bacilli smear in pleural fluid, 30–50% with mycobacterial culture and 21–47% with a nucleic acid amplification test compared to a composite reference standard [21]. Pleural biopsy (closed or guided by video-thoracoscopy) is more sensitive but also more invasive, and hence, it is not suitable in all clinical scenarios; further, Mycobacterium tuberculosis grows in pleural tissue culture in 75% of cases, the others being diagnosed based on the histological finding of granuloma in pleural tissue, which shows a specificity of 95% but gives no information regarding microbiological characteristics or drug resistance [22].
Due to all the above, great efforts have been made over recent decades to obtain a surrogate diagnostic tool for TPE, pleural fluid biomarkers being the most extensively explored. They provide a probability for ruling in and/or ruling out the disease, and among them, ADA is the most cost-effective, it is standardized and it has a universally accepted diagnostic cut-off value (40 U/l) [12]. Its combination with lymphocyte percentage increases ADA’s specificity [23], as we also confirmed in our first study from 1998 to 2008 [13]. In our second study [12], we included both variables in an ML approach. This third study is an external validation of the latter, and we performed it in a higher TPE prevalence scenario.
Using the ADA 40 + LP 50 criterion, specificity decreases when moving from a high- to a low-incidence scenario. This is because, proportionally, there are more malignant samples with ADA > 40 U/l in low-incidence scenarios, which increases the number of false positives (8 classified erroneously as tuberculous out of a total of 256 non-tuberculous samples in the case of Bajo Deba, compared to 14 classified erroneously as tuberculous out of a total of 224 non-tuberculous samples in the case of Gipuzkoa).
Nonetheless, some ML models show a less marked decrease in specificity when transitioning from the high- to the low-incidence scenario. For example, the SVC achieved sensitivities and specificities of 98% and 96% in Gipuzkoa and 88% and 98% in Bajo Deba, while the logistic regression classifier provided sensitivities and specificities, respectively, of 98% and 94% in Gipuzkoa and 86% and 98% in Bajo Deba. This is because these models rely not only on the ADA 40 + LP 50 criterion but also a combination of other features, each with its relative influence, ADA and age being the most important ones.
Both the ADA 40 + LP 50 criterion and the ML models provide lower sensitivity in Gipuzkoa than in Bajo Deba health district. This can be explained by two factors. Firstly, there were quite a few cases of TB in Bajo Deba with ADA below 40 U/l (in the first pleural fluid sample), while there are virtually no such cases in Gipuzkoa, causing both the ML models and the ADA > 40 criterion to fail to generalize correctly in the Bajo Deba dataset. Secondly, and this affects only the ML models, the patterns of ADA and age, the two most discriminatory variables, are not the same in the Gipuzkoa and Bajo Deba datasets. Fig 5 shows the tuberculous, malignant, and other cases as a function of ADA and age in Gipuzkoa (left) and in Bajo Deba (right). False negatives produced by the SVC in the Bajo Deba dataset have also been marked with red crosses. As can be seen, there was much more TB circulating in the young population in the Bajo Deba dataset (right) than in Gipuzkoa (left), and although the ML models have not seen this pattern in the training set, they are capable of generalizing well, since there were no non-tuberculous samples in those ranges of ADA and age in the Gipuzkoa dataset either. Nonetheless, there are ranges of ADA slightly above 40 U/l and ages around 80 years, where most samples in the Gipuzkoa dataset are classified as “malignant” or “other”, while in the Bajo Deba dataset, there are tuberculous samples, and hence, most of the trained ML models fail to generalize well.
[Figure omitted. See PDF.]
False negatives produced by the support vector classifier in the Bajo Deba dataset are marked with red crosses.
Comparing ML and Bayesian analysis, it can be observed that the PPV of the ML models exceeds that of ADA 40 + LP 50 in several cases, for both the Gipuzkoa and Bajo Deba datasets. Additionally, the estimated PPVs underestimate the real values obtained in the Bajo Deba dataset for all ML models as well as for the ADA 40 + LP 50-based classifier (Fig 3 and Table 4). This indicates that the “tuberculous” and “others” classes are more readily separable in the Bajo Deba than in the Gipuzkoa dataset. This is primarily attributable to the fact that there are fewer malignant cases with high ADA in Bajo Deba than in Gipuzkoa. Consequently, the projected PPV for a classifier with a sensitivity and specificity obtained in Gipuzkoa falls short of the real PPV obtained in Bajo Deba for that classifier.
Concerning the results of the three-class classification (tuberculous/malignant/others), as can be observed, practically all three-class classifiers provide sensitivity/specificity in the classification of tuberculous cases against the others similar to that of the two-class classifiers. For example, the Random Forest classifier correctly detects 47 cases of TPE out of a total of 49 in Gipuzkoa and 92 out of a total of 104 in Bajo Deba, but at the same time, it is capable of correctly classifying 118 malignant cases out of a total of 143 malignant cases in Gipuzkoa, as well as correctly classifying 74 malignant cases out of a total of 92 malignant cases in Bajo Deba (Fig 4).
This study has some limitations. First, the analysis of the testing dataset is retrospective, it has been performed in a single centre and the quality of diagnosis is lower than in the training dataset. Second, the incidence rate of TB is higher in the testing group, but at the same time, this has provided an opportunity to analyse the behaviour of the ML classifiers in different prevalence scenarios of a transmissible disease. Moreover, the number of cases included in the study, the homogeneity of the groups and the comparable behaviour of the two most important variables are positive features, enhancing the validity of our study’s findings. Our Machine Learning model is freely available as an app (at https://pleurapp.ispana.es/) to help other physicians or thoracic surgeons apply this approach when dealing with exudative and lymphocytic pleural effusions.
Conclusions
With this external validation of our previously reported model, we confirm that an ML approach combining ADA with age and routine pleural fluid parameters is suitable for predicting the diagnosis of pleural TB in any prevalence scenario, and secondarily, for discriminating the cases most likely to be malignant amongst exudative and lymphocytic non-tuberculous effusions. Additionally, we conclude that ML is more accurate than Bayesian analysis in different prevalence scenarios, although the epidemiological behaviour of transmissible diseases (e.g., the relationship between incidence rate and patient age) is a challenge to be tackled in developing ML approaches.
Supporting information
S1 Table. Number of cases by diagnosis obtained in the Training and Testing groups.
https://doi.org/10.1371/journal.pone.0329668.s001
(DOCX)
S2 Table. Diagnostic criteria met by tuberculous and malignant cases (listing each case just once under the highest quality criterion among all the criteria met).
https://doi.org/10.1371/journal.pone.0329668.s002
(DOCX)
References
1. 1. Global tuberculosis report 2024 [Internet]. Geneva: World Health Organization; 2024. Available from: https://www.who.int/teams/global-tuberculosis-programme/tb-reports/global-tuberculosis-report-2024/tb-disease-burden
2. 2. Cohen LA, Light RW. Tuberculous pleural effusion. Turk Thorac J. 2015;16:1–9.
* View Article
* Google Scholar
3. 3. Palma RM, Bielsa S, Esquerda A, Martínez-Alonso M, Porcel JM. Diagnostic Accuracy of Pleural Fluid Adenosine Deaminase for Diagnosing Tuberculosis. Meta-analysis of Spanish Studies. Arch Bronconeumol (Engl Ed). 2019;55(1):23–30. pmid:30612601
* View Article
* PubMed/NCBI
* Google Scholar
4. 4. Greco S, Girardi E, Masciangelo R. Adenosine deaminase and interferon gamma measurements for the diagnosis of tuberculous pleurisy: a meta-analysis. Int J Tuberc Lung Dis. 2003;7:777–86.
* View Article
* Google Scholar
5. 5. Liang Q-L, Shi H-Z, Wang K, Qin S-M, Qin X-J. Diagnostic accuracy of adenosine deaminase in tuberculous pleurisy: a meta-analysis. Respir Med. 2008;102(5):744–54. pmid:18222681
* View Article
* PubMed/NCBI
* Google Scholar
6. 6. Aggarwal AN, Agarwal R, Sehgal IS, Dhooria S. Adenosine deaminase for diagnosis of tuberculous pleural effusion: A systematic review and meta-analysis. PLoS One. 2019;14(3):e0213728. pmid:30913213
* View Article
* PubMed/NCBI
* Google Scholar
7. 7. Morisson P, Neves DD. Evaluation of adenosine deaminase in the diagnosis of pleural tuberculosis: a Brazilian meta-analysis. J Bras Pneumol. 2008;34(4):217–24. pmid:18425258
* View Article
* PubMed/NCBI
* Google Scholar
8. 8. Mummadi SR, Stoller JK, Lopez R, et al. Epidemiology of Adult Pleural Disease in the United States. Chest. 2021;160:1534–51.
* View Article
* Google Scholar
9. 9. Porcel JM. Biomarkers in the diagnosis of pleural diseases: a 2018 update. Ther Adv Respir Dis. 2018;12:1753466618808660. pmid:30354850
* View Article
* PubMed/NCBI
* Google Scholar
10. 10. Antonangelo L, Faria CS, Sales RK. Tuberculous pleural effusion: diagnosis & management. Expert Rev Respir Med. 2019;13(8):747–59. pmid:31246102
* View Article
* PubMed/NCBI
* Google Scholar
11. 11. Shaw JA, Ahmed L, Koegelenberg CFN. Effusions related to TB. In: Maskell NA, Laursen CB, Lee YCG, et al., editors. Pleural Disease [Internet]. Sheffield, United Kingdom: European Respiratory Society; 2020 [cited 2024 May 22]. p. 172–192. Available from: http://erspublications.com/lookup/doi/10.1183/2312508X.10023819
12. 12. Garcia-Zamalloa A, Vicente D, Arnay R, Arrospide A, Taboada J, Castilla-Rodríguez I, et al. Diagnostic accuracy of adenosine deaminase for pleural tuberculosis in a low prevalence setting: A machine learning approach within a 7-year prospective multi-center study. PLoS One. 2021;16(11):e0259203. pmid:34735491
* View Article
* PubMed/NCBI
* Google Scholar
13. 13. Garcia-Zamalloa A, Taboada-Gomez J. Diagnostic accuracy of adenosine deaminase and lymphocyte proportion in pleural fluid for tuberculous pleurisy in different prevalence scenarios. PLoS One. 2012;7(6):e38729. pmid:22723878
* View Article
* PubMed/NCBI
* Google Scholar
14. 14. Tuberculosis Prevention and Control Program. Workgroup. Consensus document. 2001. Available from: https://www.ogasun.ejgv.euskadi.eus/r51-catpub/es/k75aWebPublicacionesWar/k75aObtenerPublicacionDigitalServlet?R01HNoPortal=true&N_LIBR=051622&N_EDIC=0001&C_IDIOM=es&FORMATO=.pdf
15. 15. Roberts ME, Rahman NM, Maskell NA, Bibby AC, Blyth KG, Corcoran JP, et al. British Thoracic Society Guideline for pleural disease. Thorax. 2023;78(11):1143–56. pmid:37553157
* View Article
* PubMed/NCBI
* Google Scholar
16. 16. Herrera Lara S, Fernández-Fabrellas E, Juan Samper G, Marco Buades J, Andreu Lapiedra R, Pinilla Moreno A, et al. Predicting Malignant and Paramalignant Pleural Effusions by Combining Clinical, Radiological and Pleural Fluid Analytical Parameters. Lung. 2017;195(5):653–60. pmid:28656381
* View Article
* PubMed/NCBI
* Google Scholar
17. 17. Valdés L, Ferreiro L, Cruz-Ferro E, González-Barcala FJ, Gude F, Ursúa MI, et al. Recent epidemiological trends in tuberculous pleural effusion in Galicia, Spain. Eur J Intern Med. 2012;23(8):727–32. pmid:22818626
* View Article
* PubMed/NCBI
* Google Scholar
18. 18. Garcia Zamalloa A, Taboada Gómez J, Arrospide Elgerresta A. Pleural tuberculosis in young people as an indicator of general tuberculosis rate. Eur Respir J. 2014;44:P2689.
* View Article
* Google Scholar
19. 19. Vorster MJ, Allwood BW, Diacon AH, Koegelenberg CFN. Tuberculous pleural effusions: advances and controversies. J Thorac Dis. 2015;7(6):981–91. pmid:26150911
* View Article
* PubMed/NCBI
* Google Scholar
20. 20. Sahn SA, Huggins JT, San José ME, Álvarez-Dobaño JM, Valdés L. Can tuberculous pleural effusions be diagnosed by pleural fluid analysis alone? Int J Tuberc Lung Dis. 2013;17(6):787–93. pmid:23676163
* View Article
* PubMed/NCBI
* Google Scholar
21. 21. Chan KKP, Lee YCG. Tuberculous pleuritis: clinical presentations and diagnostic challenges. Curr Opin Pulm Med. 2024;30(3):210–6. pmid:38323466
* View Article
* PubMed/NCBI
* Google Scholar
22. 22. Porcel JM. Advances in the diagnosis of tuberculous pleuritis. Ann Transl Med. 2016;4(15):282. pmid:27570776
* View Article
* PubMed/NCBI
* Google Scholar
23. 23. Burgess LJ, Maritz FJ, Le Roux I, Taljaard JJ. Combined use of pleural adenosine deaminase with lymphocyte/neutrophil ratio. Increased specificity for the diagnosis of tuberculous pleuritis. Chest. 1996;109(2):414–9. pmid:8620715
* View Article
* PubMed/NCBI
* Google Scholar
Citation: Garcia-Zamalloa A, Arnay R, Castilla-Rodriguez I, Mar J, Gonzalez-Cava JM, Ibarrondo O, et al. (2025) Machine learning for predicting the diagnosis of tuberculous versus malignant pleural effusion: External validation and accuracy in two different settings. PLoS One 20(9): e0329668. https://doi.org/10.1371/journal.pone.0329668
About the Authors:
Alberto Garcia-Zamalloa
Roles: Conceptualization, Data curation, Investigation, Writing – original draft, Writing – review & editing
E-mail: [email protected]
Affiliation: Respiratory and Pleural Diseases Group. Biogipuzkoa Health Research Institute. Internal Medicine Service, Osakidetza/Basque Health Service, Mendaro Hospital, Spain
ORICD: https://orcid.org/0000-0001-9959-2429
Rafael Arnay
Roles: Conceptualization, Formal analysis, Methodology, Software, Validation, Writing – original draft, Writing – review & editing
Affiliation: Departamento de Ingeniería Informática y de Sistemas, Universidad de La Laguna, Santa Cruz de Tenerife, Spain
Iván Castilla-Rodriguez
Roles: Formal analysis, Methodology, Software, Validation, Writing – original draft, Writing – review & editing
Affiliation: Departamento de Ingeniería Informática y de Sistemas, Universidad de La Laguna, Santa Cruz de Tenerife, Spain
ORICD: https://orcid.org/0000-0003-3933-2582
Javier Mar
Roles: Formal analysis, Methodology, Writing – original draft, Writing – review & editing
Affiliation: Epidemiology and Public Health Area, Economic Evaluation of Chronic Diseases Research Group, Biogipuzkoa Health Research Institute, Donostia, Spain
Jose Manuel Gonzalez-Cava
Roles: Formal analysis, Methodology
Affiliation: Departamento de Ingeniería Informática y de Sistemas, Universidad de La Laguna, Santa Cruz de Tenerife, Spain
Oliver Ibarrondo
Roles: Formal analysis, Methodology
Affiliation: Western Gipuzkoa Clinical Research Unit, Osakidetza/Basque Health Service, Mendaro Hospital, Gipuzkoa, Spain
ORICD: https://orcid.org/0000-0003-3310-719X
Iñaki Salegui
Roles: Data curation
Affiliation: Respiratory and Pleural Diseases Group. Biogipuzkoa Health Research Institute. Pneumology Service, Osakidetza/Basque Health Service, Donostia University Hospital, Gipuzkoa, Spain
Juan Antonio De Miguel
Roles: Data curation, Investigation
Affiliation: Respiratory and Pleural Diseases Group. Biogipuzkoa Health Research Institute. Pneumology Service, Osakidetza/Basque Health Service, Donostia University Hospital, Gipuzkoa, Spain
Nekane Mugica
Roles: Data curation
Affiliation: Respiratory and Pleural Diseases Group. Biogipuzkoa Health Research Institute. Pneumology Service, Osakidetza/Basque Health Service, Donostia University Hospital, Gipuzkoa, Spain
Borja Aguinagalde
Roles: Data curation, Investigation
Affiliation: Respiratory and Pleural Diseases Group. Biogipuzkoa Health Research Institute. Thoracic Surgery Service, Osakidetza/Basque Health Service, Donostia University Hospital, Gipuzkoa, Spain
ORICD: https://orcid.org/0000-0003-4083-3579
Jon Zabaleta
Roles: Data curation
Affiliation: Respiratory and Pleural Diseases Group. Biogipuzkoa Health Research Institute. Thoracic Surgery Service, Osakidetza/Basque Health Service, Donostia University Hospital, Gipuzkoa, Spain
ORICD: https://orcid.org/0000-0001-8837-0580
Begoña Basauri
Roles: Conceptualization
Affiliation: Biochemistry Laboratory, Osakidetza/Basque Health Service, Mendaro Hospital, Gipuzkoa, Spain
Marta Alonso
Roles: Data curation
Affiliation: Microbiology Department, Respiratory Infection and Antimicrobial Resistance Group. Osakidetza/Basque Health Service, Biogipuzkoa Health Research Institute, Donostia University Hospital, Gipuzkoa, Spain
Nekane Azcue
Roles: Data curation
Affiliation: Microbiology Department, Respiratory Infection and Antimicrobial Resistance Group. Osakidetza/Basque Health Service, Biogipuzkoa Health Research Institute, Donostia University Hospital, Gipuzkoa, Spain
Eva Gil
Roles: Data curation
Affiliation: Biochemistry Laboratory, Osakidetza/Basque Health Service, Donostia University Hospital, Gipuzkoa, Spain
Irati Garmendia
Roles: Formal analysis, Investigation
Affiliation: Oncology Area, Biogipuzkoa Health Research Institute, Gipuzkoa, Spain
ORICD: https://orcid.org/0000-0001-7124-6137
Jorge Taboada
Roles: Conceptualization
Affiliations: Western Gipuzkoa Clinical Research Unit, Osakidetza/Basque Health Service, Mendaro Hospital, Gipuzkoa, Spain, Preventive Medicine and Public Health Service, Bilbao-Basurto Integrated Organization, Bizkaia, Spain.
[/RAW_REF_TEXT]
[/RAW_REF_TEXT]
[/RAW_REF_TEXT]
1. Global tuberculosis report 2024 [Internet]. Geneva: World Health Organization; 2024. Available from: https://www.who.int/teams/global-tuberculosis-programme/tb-reports/global-tuberculosis-report-2024/tb-disease-burden
2. Cohen LA, Light RW. Tuberculous pleural effusion. Turk Thorac J. 2015;16:1–9.
3. Palma RM, Bielsa S, Esquerda A, Martínez-Alonso M, Porcel JM. Diagnostic Accuracy of Pleural Fluid Adenosine Deaminase for Diagnosing Tuberculosis. Meta-analysis of Spanish Studies. Arch Bronconeumol (Engl Ed). 2019;55(1):23–30. pmid:30612601
4. Greco S, Girardi E, Masciangelo R. Adenosine deaminase and interferon gamma measurements for the diagnosis of tuberculous pleurisy: a meta-analysis. Int J Tuberc Lung Dis. 2003;7:777–86.
5. Liang Q-L, Shi H-Z, Wang K, Qin S-M, Qin X-J. Diagnostic accuracy of adenosine deaminase in tuberculous pleurisy: a meta-analysis. Respir Med. 2008;102(5):744–54. pmid:18222681
6. Aggarwal AN, Agarwal R, Sehgal IS, Dhooria S. Adenosine deaminase for diagnosis of tuberculous pleural effusion: A systematic review and meta-analysis. PLoS One. 2019;14(3):e0213728. pmid:30913213
7. Morisson P, Neves DD. Evaluation of adenosine deaminase in the diagnosis of pleural tuberculosis: a Brazilian meta-analysis. J Bras Pneumol. 2008;34(4):217–24. pmid:18425258
8. Mummadi SR, Stoller JK, Lopez R, et al. Epidemiology of Adult Pleural Disease in the United States. Chest. 2021;160:1534–51.
9. Porcel JM. Biomarkers in the diagnosis of pleural diseases: a 2018 update. Ther Adv Respir Dis. 2018;12:1753466618808660. pmid:30354850
10. Antonangelo L, Faria CS, Sales RK. Tuberculous pleural effusion: diagnosis & management. Expert Rev Respir Med. 2019;13(8):747–59. pmid:31246102
11. Shaw JA, Ahmed L, Koegelenberg CFN. Effusions related to TB. In: Maskell NA, Laursen CB, Lee YCG, et al., editors. Pleural Disease [Internet]. Sheffield, United Kingdom: European Respiratory Society; 2020 [cited 2024 May 22]. p. 172–192. Available from: http://erspublications.com/lookup/doi/10.1183/2312508X.10023819
12. Garcia-Zamalloa A, Vicente D, Arnay R, Arrospide A, Taboada J, Castilla-Rodríguez I, et al. Diagnostic accuracy of adenosine deaminase for pleural tuberculosis in a low prevalence setting: A machine learning approach within a 7-year prospective multi-center study. PLoS One. 2021;16(11):e0259203. pmid:34735491
13. Garcia-Zamalloa A, Taboada-Gomez J. Diagnostic accuracy of adenosine deaminase and lymphocyte proportion in pleural fluid for tuberculous pleurisy in different prevalence scenarios. PLoS One. 2012;7(6):e38729. pmid:22723878
14. Tuberculosis Prevention and Control Program. Workgroup. Consensus document. 2001. Available from: https://www.ogasun.ejgv.euskadi.eus/r51-catpub/es/k75aWebPublicacionesWar/k75aObtenerPublicacionDigitalServlet?R01HNoPortal=true&N_LIBR=051622&N_EDIC=0001&C_IDIOM=es&FORMATO=.pdf
15. Roberts ME, Rahman NM, Maskell NA, Bibby AC, Blyth KG, Corcoran JP, et al. British Thoracic Society Guideline for pleural disease. Thorax. 2023;78(11):1143–56. pmid:37553157
16. Herrera Lara S, Fernández-Fabrellas E, Juan Samper G, Marco Buades J, Andreu Lapiedra R, Pinilla Moreno A, et al. Predicting Malignant and Paramalignant Pleural Effusions by Combining Clinical, Radiological and Pleural Fluid Analytical Parameters. Lung. 2017;195(5):653–60. pmid:28656381
17. Valdés L, Ferreiro L, Cruz-Ferro E, González-Barcala FJ, Gude F, Ursúa MI, et al. Recent epidemiological trends in tuberculous pleural effusion in Galicia, Spain. Eur J Intern Med. 2012;23(8):727–32. pmid:22818626
18. Garcia Zamalloa A, Taboada Gómez J, Arrospide Elgerresta A. Pleural tuberculosis in young people as an indicator of general tuberculosis rate. Eur Respir J. 2014;44:P2689.
19. Vorster MJ, Allwood BW, Diacon AH, Koegelenberg CFN. Tuberculous pleural effusions: advances and controversies. J Thorac Dis. 2015;7(6):981–91. pmid:26150911
20. Sahn SA, Huggins JT, San José ME, Álvarez-Dobaño JM, Valdés L. Can tuberculous pleural effusions be diagnosed by pleural fluid analysis alone? Int J Tuberc Lung Dis. 2013;17(6):787–93. pmid:23676163
21. Chan KKP, Lee YCG. Tuberculous pleuritis: clinical presentations and diagnostic challenges. Curr Opin Pulm Med. 2024;30(3):210–6. pmid:38323466
22. Porcel JM. Advances in the diagnosis of tuberculous pleuritis. Ann Transl Med. 2016;4(15):282. pmid:27570776
23. Burgess LJ, Maritz FJ, Le Roux I, Taljaard JJ. Combined use of pleural adenosine deaminase with lymphocyte/neutrophil ratio. Increased specificity for the diagnosis of tuberculous pleuritis. Chest. 1996;109(2):414–9. pmid:8620715
You have requested "on-the-fly" machine translation of selected content from our databases. This functionality is provided solely for your convenience and is in no way intended to replace human translation. Show full disclaimer
Neither ProQuest nor its licensors make any representations or warranties with respect to the translations. The translations are automatically generated "AS IS" and "AS AVAILABLE" and are not retained in our systems. PROQUEST AND ITS LICENSORS SPECIFICALLY DISCLAIM ANY AND ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES FOR AVAILABILITY, ACCURACY, TIMELINESS, COMPLETENESS, NON-INFRINGMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Your use of the translations is subject to all use restrictions contained in your Electronic Products License Agreement and by using the translation functionality you agree to forgo any and all claims against ProQuest or its licensors for your use of the translation functionality and any output derived there from. Hide full disclaimer
© 2025 Garcia-Zamalloa et al. This is an open access article distributed under the terms of the Creative Commons Attribution License: http://creativecommons.org/licenses/by/4.0/ (the “License”), which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Abstract
Objective
To perform an external validation of a previously reported machine learning (ML) approach for predicting the diagnosis of pleural tuberculosis.
Patients and Methods
We defined two cohorts: a Training group, comprising 273 out of 1,220 effusions from our prospective study (2013–2022); and a Testing group, from a retrospective analysis of 360 effusions from 832 consecutive patients in Bajo Deba health district (1996–2012). All the effusions included were exudative and lymphocytic. In Training and Testing groups respectively, 49 and 104 cases were tuberculous, 143 and 92 were malignant, and 81 and 164 were diagnosed with “other diseases”; pre-test probabilities of pleural tuberculosis were 4% and 12.7%. Variables included were: age, pH, adenosine deaminase, glucose, protein, and lactate dehydrogenase levels, and white cell counts (total and differential) in pleural fluid. We used two ML classifiers: binary (tuberculous and non-tuberculous), and three-class (tuberculous, malignant, and others); and compared them with Bayesian analysis.
Results
The best binary classifier yielded a sensitivity of 88%, specificity of 98%, and accuracy of 95%. The best three-class classifier achieved the same accuracy and correctly classified 83% (77/92) of malignant cases. The ML models yielded higher positive predictive values than Bayesian analysis based on ADA > 40 U/l and lymphocyte percentage ≥ 50% (92%).
Conclusions
This external validation confirms the good performance of the previously reported ML approach for predicting the diagnosis of pleural tuberculosis based on exudative and lymphocytic pleural effusions, and for discriminating the cases most likely to be malignant. Additionally, ML was more accurate than the Bayesian approach in our study.
You have requested "on-the-fly" machine translation of selected content from our databases. This functionality is provided solely for your convenience and is in no way intended to replace human translation. Show full disclaimer
Neither ProQuest nor its licensors make any representations or warranties with respect to the translations. The translations are automatically generated "AS IS" and "AS AVAILABLE" and are not retained in our systems. PROQUEST AND ITS LICENSORS SPECIFICALLY DISCLAIM ANY AND ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES FOR AVAILABILITY, ACCURACY, TIMELINESS, COMPLETENESS, NON-INFRINGMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Your use of the translations is subject to all use restrictions contained in your Electronic Products License Agreement and by using the translation functionality you agree to forgo any and all claims against ProQuest or its licensors for your use of the translation functionality and any output derived there from. Hide full disclaimer
Details
; Arnay, Rafael; Castilla-Rodriguez, Iván
; Mar, Javier; Gonzalez-Cava, Jose Manuel; Ibarrondo, Oliver
; Salegui, Iñaki; De Miguel, Juan Antonio; Mugica, Nekane; Aguinagalde, Borja
; Zabaleta, Jon
; Basauri, Begoña; Alonso, Marta; Azcue, Nekane; Gil, Eva; Garmendia, Irati
; Taboada, Jorge



