Blog

Blog about R Programming in Lab Medicine. A Repository of Knowledge and Applications



May/2024: The Transformative Potential of Machine Learning in Laboratory Medicine


In the article “Applications of Machine Learning in Routine Laboratory Medicine: Current State and Future Directions”, published in Clinical Biochemistry in May 2023, authors Naveed Rabbani, Grace Y. E. Kim, Carlos J. Suarez, and Jonathan H. Chen explore the transformative potential of machine learning (ML) in laboratory medicine.

Machine learning leverages vast amounts of data to identify complex patterns that rule-based systems and human experts might miss. Its application in laboratory medicine is particularly promising, as laboratory testing forms the foundation of clinical decision-making.

Unlike traditional programs defined by pre-coded rules, ML algorithms learn from past examples to predict future outcomes. In medicine, the most common form of ML, supervised learning, involves training models on labeled datasets to make predictions.

There are different subcategories within machine learning. Supervised learning uses labeled data to train models, with common algorithms including linear and logistic regression, support vector machines, and tree-based models such as random forest and XGBoost. Unsupervised learning identifies patterns in unlabeled data, with examples like k-means clustering and principal component analysis. Deep learning, a subset of ML inspired by neural networks, can perform complex tasks like image recognition and language interpretation.

The authors conducted a comprehensive PubMed search to identify relevant articles, focusing on ML applications in routine laboratory testing and laboratory information systems. The review revealed several exciting applications of ML in laboratory medicine.

For example, ML models can predict lab test results based on other clinical data, optimizing test utilization and supporting clinical decision-making. A neural network model predicted iron deficiency anemia with an AUROC of 98%.

Additionally, ML algorithms validate test results and automate quality control processes. An ensemble of tree-based algorithms verified lab results with 99.9% sensitivity and 98% specificity.

ML also aids in interpreting test results and creating personalized reference ranges. A tree-based model reduced false positives in newborn screening without sacrificing sensitivity.

Another application is in improving laboratory information systems, where ML facilitates clinical research by mapping lab data to standard codes like LOINC. A tree-based model mapped lab data to LOINC codes with 98% accuracy.

Finally, a study showed that ML could recommend which lab tests doctors should order based on clinical diagnoses, medications, prior lab tests, and demographic information. This neural network model achieved an AUROCmacro of 0.76 and an AUROCmicro of 0.87.

The authors highlight the potential of ML to automate laboratory processes, create personalized interpretations of test results, and improve clinical decision-making. They envision future algorithms providing precision diagnostics based on comprehensive clinical contexts.

Despite its promise, ML in laboratory medicine faces significant challenges, such as data quality, standardization and regulation, and computational and financial costs. Implementing ML requires substantial computational resources and expertise.

In conclusion, machine learning promises significant advancements in laboratory medicine, but the field is still in its early stages. Standardization, regulation, and high-quality data are essential for fully realizing ML’s potential. Despite the challenges, ML models are already demonstrating excellent performance in automating test validation and optimizing laboratory operations.


May/2024: Best Practices for Implementing Machine Learning in Clinical Laboratories: Insights from the IFCC Working Group


In the article “Machine Learning in Laboratory Medicine: Recommendations of the IFCC Working Group”, published in Clinical Chemistry in July 2023, authors Stephen R. Master, Tony C. Badrick, Andreas Bietenbeck, and Shannon Haymond provide comprehensive guidance on applying machine learning (ML) in clinical laboratory settings.

The article emphasizes that ML has shown tremendous potential for clinical applications in laboratory medicine. However, the development and validation of ML models must be carefully controlled to avoid common pitfalls.

The ML development process is a multistep, iterative procedure that includes: Formulating the Problem, Collecting and Preparing Data, Validating and Selecting Models, Reproducible Workflow.

Ethical ML ensures nondiscriminatory and equitable predictions.

Key ethical considerations include:

  • Using representative training sets.
  • Handling demographic and sociological characteristics cautiously.
  • Avoiding biases that could affect future patients.

The IFCC Working Group outlines twelve key recommendations:

  • State the ML Objective;
  • Detail Clinical Scenarios;
  • Describe Data Collection and Processing;
  • Prevent Data Leakage;
  • Use Representative Data;
  • Follow Ethical Design Checklists;
  • Perform Cross-Validation;
  • Report Performance Metrics;
  • Evaluate Clinical Utility;
  • Include External Validation;
  • Provide Data and Code for Validation;
  • Verify Generalizability.

The article acknowledges that it does not cover the regulatory implications and ongoing learning algorithms. It focuses on static ML classifiers and emphasizes the need for further research and discussion on these emerging areas.


May/2024: Machine learning-based clinical decision support using laboratory data


In the article “Machine learning-based clinical decision support using laboratory data”, published in the journal Clinical Chemistry and Laboratory Medicine in May 2024, authors Hikmet Can Çubukçu, Deniz İlhan Topcu, and Sedef Yenice explore how machine learning (ML) techniques are revolutionizing clinical decision support using laboratory data.

Advances in artificial intelligence (AI) and machine learning (ML) have significant potential to transform laboratory medicine and the healthcare sector as a whole. These technologies not only improve diagnostic accuracy but also increase treatment efficiency, offering healthcare professionals powerful tools to enhance patient care.

The development of ML models involves several stages, such as data collection and cleaning, feature engineering, model development, and optimization. Recently, automated machine learning (AutoML) tools have been introduced to simplify this process, allowing experts without deep technical knowledge to develop effective models.

Clinical decision support systems (CDS) play a crucial role in interpreting test results, reducing subjectivity, and minimizing inconsistencies. By utilizing AI and ML, these systems can significantly enhance areas such as early and accurate diagnoses, personalized treatment planning, prognostics, medication management, and continuous patient monitoring.

In the laboratory testing process, machine learning is applied at different stages:

  • In the pre-analytical phase, ML can detect clots, identify mislabeled samples, manage sample dilution, detect chemical manipulations in urine samples, and assess serum quality;
  • In the analytical phase, ML is used for analyzing cell images, evaluating mass spectrometry results, and real-time quality control;
  • In the post-analytical phase, ML helps predict disease outcomes and differentiate between medical conditions.

Despite the many benefits, integrating ML into laboratory medicine faces significant challenges, such as model uncertainties, the “black box” nature of algorithms, and the need for external validation and model explainability. Overcoming these challenges requires close collaboration between healthcare professionals and AI experts, the use of hybrid intelligence, comprehensive performance evaluations, and ensuring well-categorized and standardized clinical data.

In summary, ML-based decision support systems have the potential to drastically improve clinical decision-making. However, successful adoption of these technologies requires careful attention to ethical and transparency issues.




Published in 2023: Embracing the R Programming Language: A Future-Oriented Tool for Clinical Laboratories


The article titled “Why Clinical Laboratorians Should Embrace the R Programming Language”, published on the AACC’s website in 2020, emphasizes the importance of the R programming language for clinical laboratories. As the reliance on data analysis increases, clinical laboratories are generating, processing, and storing transactional data with a high level of quality and efficiency. These data are not only essential for patient care and quality assurance activities but are also increasingly being used to guide operational decisions.

The article argues that the R programming language is ideal for clinical laboratories due to its open, platform-independent, and free nature, as well as having a massive, global user and contributor base. Applications of R in medicine are growing due to the increasing visibility of R’s versatility and the availability of relevant, focused training.

R is highly customizable, reproducible, and can be automated. It is widely used for its graphic and reporting capabilities, including the ability to render publication-quality figures with interactivity and generate web-based dashboards and other reports in a variety of formats.

The article also discusses how to start programming with R, the five key attributes of R, examples of R applications in clinical laboratories, and resources for new R programmers. In addition, the article emphasizes that they believe that clinical laboratories will require increasing use of data analytics to optimize operations, manage utilization, and provide improved interpretation of complex laboratory data in the context of patients’ medical records.




Published in 2023: Healthcare Revolution: The Power of Artificial Intelligence and Data Science in Laboratory Medicine


The review article titled “Data science, artificial intelligence, and machine learning: Opportunities for laboratory medicine and the value of positive regulation” was penned by Damien Gruson and Thibault Helleputte, and published in the Clinical Biochemistry journal in the year 2019.

The article delves into how data science, artificial intelligence, and machine learning are unlocking new opportunities for laboratory medicine. With the increasing amount and diversity of data that healthcare professionals are exposed to, these technologies prove useful for the holistic interpretation of this information.

In this scenario, machine learning algorithms require three main ingredients: learning algorithms, computational power, and data. With the advancement of technology, we now have access to a vast amount of patient data, immense computational power, and well-developed learning algorithms.

With the development of cloud computing infrastructures, several machine learning frameworks have been proposed for the growing number of non-data scientists. However, for relevant and robust results, it is best to rely on custom approaches designed and implemented by experts. 

The complexity of laboratory processes and the challenges associated with their integration into care pathways are evident. Data science can help overcome these challenges and improve the efficiency of health processes. However, translating data science and AI into daily practices presents several challenges, including the collection and sharing of data with potentially sensitive information. This has raised major concerns about privacy.

Key 1 - Patient information and consent: The patient must be informed before the use of any AI technology in the course of their care. The AI device should not replace the collection of patient consent.

Key 2 - AI human warranty: The principle of AI human warranty in health should be respected. This warranty should be ensured by the regular verification of the management options proposed by the AI device.

Key 3 - Graduation of regulation according to the level of sensitivity of health data: In accordance with the principles of bioethics law, the regulation of the implementation of an AI device for the processing of large amounts of health data should be graduated according to the sensitivity of these data.

Key 4 - Accompaniment of the adaptation of health professions: The implementation of data science-based devices for data processing or robotics will require the adaptation of health professions.

Key 5 - Need for independent guidance: An independent guidance group should be implemented to examine the efforts made to promote the four keys outlined above.

Data science and AI present significant challenges, including technical, legal, financial, and ethical challenges. However, these challenges can be overcome through technical developments, such as distributed learning, and the implementation of positive regulations. Data science has the potential to transform laboratory medicine and improve the efficiency of health processes.




Published in 2023: Unveiling The-Lab-R-Torian: A Beacon of R Programming in Laboratory Medicine


Established in 2015, “The-Lab-R-Torian” is a specialized blog dedicated to Laboratory Medicine. It is curated by Daniel T. Holmes, Head of the Department of Pathology and Laboratory Medicine at St. Paul’s Hospital in Vancouver. The blog primarily focuses on the application of the statistical programming language ‘R’ within Clinical Laboratory Medicine, offering a wealth of posts on the subject. This makes it an invaluable resource for professionals and enthusiasts in the field.