This Python tool calculates the Anticholinergic Burden (ACB) score for patients based on their medication.
Clone the repository and install dependencies:
git clone https://github.com/juliasbrain/acb_score_calculator.git
cd acb_score_calculator
pip install -r requirements.txt
The function requires a DataFrame containing patient medication data in the following format:
- 'Subject_ID': A unique identifier for each patient.
- Other columns: Medication names and doses for each session, formatted as
"Medication: dose"
. Each column represents a different medication for each session.
Example:
Subject_ID | Medication01 | Medication02 | Medication03 |
---|---|---|---|
sub001 | Amitriptyline: 25mg | Loperamide: 2mg | None |
sub002 | Diphenhydramine: 50mg | Risperidone: 1mg | Clonazepam: 0.5mg |
The function generates a CSV file with the following columns:
- 'Subject_ID': A unique identifier for each patient.
- 'acb_score_total': The total ACB score for each patient, calculated based on the medications provided.
The CSV file will be saved in the specified output directory (or the current directory if not specified).
Example:
Subject_ID | acb_score_total |
---|---|
sub001 | 4 |
sub002 | 5 |
- Import the function:
from acb_score_calculator import acb_score
- Load the medication data:
# Load csv file:
medication_df = pd.read_csv(/path/to/medication_df/medication_df.csv')
# Load excel file:
medication_df = pd.read_excel('/path/to/medication_df.xlsx')
- Calculate ACB scores
acb_score(medication_df, output_dir='./output') # Optional: Specify output directory
The ACB scores used in this repository are sourced from the German Anticholinergic Burden (ACB) score developed by Kiesel et al., 2018 [1].
[1] Kiesel EK, Hopf YM, Drey M. An anticholinergic burden score for German prescribers: score development. BMC Geriatr. 2018 Oct 11;18(1):239. doi: 10.1186/s12877-018-0929-6. PMID: 30305048; PMCID: PMC6180424.