wdrs_result

transform.wdrs_result(subtype: str)

WDRS Test Result

Usage

The function can be called into a .with_columns() statement. It will reference the dataframe’s status column and output a cleaned version of it.

Parameters

subtype : str

subtype column

Examples

import polars as pl
import wadoh_subtyping.transform as tf
from wadoh_raccoon.utils import helpers

df = pl.DataFrame({
    "ResultTextConclusion": [
        "Influenza A virus detected by RT-PCR {58}",
        "Influenza A(2009 H1N1) virus detected by RT-PCR {65}", 
        "Influenza A(H3) virus detected by RT-PCR {64}", 
        "Influenza A(H5) virus detected by RT-PCR {70}",
        "Influenza A(H7) virus detected by RT-PCR",
        "Influenza B virus detected by RT-PCR {59}",
        "Influenza B/Victoria lineage detected by RT-PCR {91}",
        "Influenza B/Yamagata lineage detected by RT-PCR {91}",
        "Inconclusive - Invalid Result {68}",
        "Influenza A virus detected by RT-PCR; Subtype undetected {66}",
        "None"

    ]
})

df = (
    df
    .with_columns(
        WDRS_RESULT=tf.wdrs_result(
            subtype='ResultTextConclusion'
        )
    )
)

helpers.gt_style(df_inp=df)
index ResultTextConclusion WDRS_RESULT
0 Influenza A virus detected by RT-PCR {58} G_FLU_A_D
1 Influenza A(2009 H1N1) virus detected by RT-PCR {65} G_FLU_A_(09_PDM_H1N1)_D
2 Influenza A(H3) virus detected by RT-PCR {64} G_FLU_A_(H3)_D
3 Influenza A(H5) virus detected by RT-PCR {70} G_FLU_A_(H5)_D
4 Influenza A(H7) virus detected by RT-PCR G_FLU_A_(H7)_D
5 Influenza B virus detected by RT-PCR {59} G_FLU_B
6 Influenza B/Victoria lineage detected by RT-PCR {91} G_FLU_B_(VICTORIA)_D
7 Influenza B/Yamagata lineage detected by RT-PCR {91} G_FLU_B_(YAMAGATA)_D
8 Inconclusive - Invalid Result {68} G_FLU_ND
9 Influenza A virus detected by RT-PCR; Subtype undetected {66} G_FLU_ND
10 None G_FLU_ND

WDRS Variable Mapping

Below are all distinct options in WDRS for the WDRS_RESULT variable and how the values map to LIMS data.

LIMS Test Results
All distinct values found
AnalyteSynonym
2009pandemic Influenza A {1049}
H1 2009pandemic {1050}
H1
H3
Influenza A(H5)a {1062}
Influenza A(H5)b {1063}
Influenza A(H7)Eu {1069}
B(Victoria) {1095}
B(Yamagata) {1094}
Influenza B
None
Adenovirus
CPE {1052}
H275
I223
Parainfluenza Type 1
Parainfluenza Type 2
Parainfluenza Type 3
Respiratory Syncytial Virus
RP
WDRS Test Results
All distinct values found
WDRS_RESULT
Influenza A (09 Pdm H1N1) detected
Influenza A (H3) detected
Influenza A (H3N2) detected
Influenza A (H5) detected
Influenza A (H7) detected
Influenza A detected
Influenza A, other detected
Influenza B (Victoria) detected
Influenza B (Yamagata) detected
Influenza B, other detected
Influenza not detected
Specimen inadequate
Manual review
Other, specify