This project generates deterministic, reproducible QC Tables, Listings, and Figures (TLFs) from CDISC SDTM and ADaM datasets for independent verification against SAS-generated TLFs. It is designed for cell-by-cell comparison in clinical trial programming QC, not for regulatory submission.
- Input: SDTM and ADaM datasets (CSV/XPT)
- Output: QC TLFs (CSV, Excel, PNG)
- Strict SAP/SAS logic adherence
- Tools: pandas, numpy, matplotlib
- Deterministic, reproducible results
- Explicit documentation of dataset/variable names, population flags, analysis parameters, grouping, ordering
- Handles missing values, sorting, rounding, decimal precision
- Load Data
- Apply Population Filters
- Apply Derivation Logic
- Generate TLFs
- Export Output
- Generate Listings
qc_outputs/table1_age_by_treatment.csv: Summary statistics for AGE by treatment armqc_outputs/listing1_subject_safety.csv: Subject-level listing for Safety populationqc_outputs/figure1_age_histogram.png: Histogram of AGE by treatment arm
- Clone the repository:
git clone https://github.com/justin-mbca/QC-TLF-Python-Verification.git
- Install Python dependencies:
pip install pandas numpy matplotlib
- Place your SDTM and ADaM datasets in the appropriate folders (
sdtm/,adam/). - Run the main script:
python TLF.py
- Modify the scripts as needed to match your SAP and SAS logic.
- Outputs will be generated in the
qc_outputs/folder. - Compare outputs with SAS-generated TLFs for QC.
- Use Python’s
subprocessmodule for local SAS execution. - Use
saspyfor remote SAS server or SAS Viya integration. - See
run_sas_from_python.pyfor examples.
- Project slides are available in markdown files and exported PPTX.
- See
QC_TLF_Project_Marp_Slides_Detailed.mdandQC_TLF_Project_Marp_Slides_Detailed.pptx.
For questions or contributions, please open an issue or contact the repository owner.