Skip to main content

No project description provided

Project description

pymsprog: reproducible assessment of disability progression in MS

Python 3.7

pymsprog provides tools for exhaustive and reproducible analysis of disability progression in multiple sclerosis (MS) from longitudinal data.

Its core function, MSprog, detects and characterises the progression events of an outcome measure (EDSS, NHPT, T25FW, or SDMT) for one or more subjects, based on repeated assessments through time and on the dates of acute episodes.

A detailed tutorial in the form of a Jupyter Notebook (pymsprog_tutorial.ipynb) is available in the repo.

Installation

You can install the latest release of pymsprog with:

pip install pymsprog

Alternatively, the development version can be downloaded from GitHub.

Usage

MSprog detects the events sequentially by scanning the outcome values in chronological order, and classifies progression events as relapse-associated or relapse-independent based on their relative timing with respect to the relapses [1, 2, 3].

Several qualitative and quantitative options for event detection are given as arguments that can be set by the user and reported as a complement to the results to ensure reproducibility. These include the baseline scheme (fixed or roving), the events to be detected (first or multiple, progression and/or improvement), the length of the relapse influence window and of the event confirmation period(s) with the relative tolerance.

The example below illustrates the function's usage and outputs:

from pymsprog import MSprog
import pandas as pd

# Load toy data
toydata_visits = pd.read_excel('MSprog_toydata.xlsx', sheet_name='visits')
toydata_relapses = pd.read_excel('MSprog_toydata.xlsx', sheet_name='relapses')


# Compute progression
summary, results = MSprog(toydata_visits,                                   # insert data on visits
                 subj_col='id', value_col='EDSS', date_col='date', # specify column names
                 event='multiple', baseline='roving',              # modify default options on event detection
                 relapse=toydata_relapses)                         # insert data on relapses


---
Outcome: EDSS
Confirmation at: [3]mm (-30dd, +30dd)
Baseline: roving
Relapse influence: 30dd
Events detected: multiple
---
Total subjects: 4
---
Progressed: 3 (PIRA: 3; RAW: 1)
Improved: 1
---
Progression events: 4 (PIRA: 3; RAW: 1)
Improved: 1

The function prints out a concise report of the results, as well as the specific set of options used to obtain them. Complete results are stored in two pandas DataFrame objects generated by the function call:

  1. A summary table providing the event count for each subject and event type:
 event_sequence  improvement  progression  RAW  PIRA  undefined_prog
           PIRA            0            1    0     1               0
      RAW, PIRA            0            2    1     1               0
                           0            0    0     0               0
     impr, PIRA            1            1    0     1               0

where: event_sequence specifies the order of the events; the other columns count the events of each type.

  1. Extended info on each event for all subjects:
   id  nevent event_type time2event conf3 sust_days sust_last
   1       1       PIRA        292     1       125         1
   2       1        RAW        198     1         0         0
   2       2       PIRA        257     1        90         1
   4       1       impr         77     1         0         0
   4       2       PIRA        129     1       204         1

where: nevent is the cumulative event count for each subject; event_type characterises the event; time2event is the number of days from baseline to event; conf3 reports whether the event was confirmed; sust_days is the number of days for which the event was sustained after confirmation; sust_last reports whether the event was sustained until the last visit.


References

[1] Lublin FD, Reingold SC, Cohen JA, Cutter GR, Sørensen PS, Thompson AJ, et al. Defining the clinical course of multiple sclerosis. Neurology [Internet]. 2014;83:278–86. Available from: https://n.neurology.org/content/83/3/278

[2] Kappos L, Butzkueven H, Wiendl H, Spelman T, Pellegrini F, Chen Y, et al. Greater sensitivity to multiple sclerosis disability worsening and progression events using a roving versus a fixed reference value in a prospective cohort study. Multiple Sclerosis Journal [Internet]. 2018;24:963–73. Available from: https://doi.org/10.1177/1352458517709619

[3] University of California SFM-ET, Cree BAC, Hollenbach JA, Bove R, Kirkish G, Sacco S, et al. Silent progression in disease activity–free relapsing multiple sclerosis. Annals of Neurology [Internet]. 2019;85:653–66. Available from: https://onlinelibrary.wiley.com/doi/abs/10.1002/ana.25463

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymsprog-0.1.1.tar.gz (16.9 kB view hashes)

Uploaded Source

Built Distribution

pymsprog-0.1.1-py3-none-any.whl (15.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page