This is a simplified version of the code used to analyze cardiopulmonary exercise testing (CPET) data in our study, "A Novel Quantification Technique for Analysis of Oxygen Pulse Curve Characteristics During Cardiopulmonary Exercise Testing in Adults with Tetralogy of Fallot." It runs the same method used fit a penalized bilinear regression curve, and provides the key calculations.
-
Create a virtual environment and install the necessary dependencies from
requirements.txt. This code was written for Python v3.10. -
Use
pseudo_data_generator.pyto create some synthetic data. The synthetic data will run, and it can be replaced with real data in the same format. You are responsible for ensuring all data provided to the code are first deidentified. A directory (OUTPUT_DIR) must be supplied.N_FILESandPLOTmay be modified as well.
OUTPUT_DIR = os.path.join(os.path.dirname(file), "pseudo_data", "")
os.mkdir(OUTPUT_DIR)
- Use
cpet_analysis.pyto analyze the data. Provide the three requested paths at the beginning of the script before running the code. Alternatively, you may setUSE_COMMAND_LINE_INTERFACEtoTrueand runpython cpet_analysis.py --helpfor intstructions on using the optional CLI.
META_DATA_PATH: str = "pseudo_data/meta_data.csv"
MERGED_DATA_PATH: str = "pseudo_data/meta_data.csv"
OUTPUT_DIR: str = os.path.dirname(file)
Please cite our work if you use our code. Questions may be directed to the corresponding author. DOI: 10.1016/j.ijcchd.2024.100539