Giter VIP home page Giter VIP logo

ehr-vha's Introduction

Data

toy_paths.txt

  • randomly generated disease paths for test runs

outpat_males_edgelist_unfiltered -> outpatient_males_cooccurrence.csv

  • disease pairs and number of total co-occurrence in patients

bigram_final -> outpatient_males_disease_steps.csv

  • number of patients in which the disease in source is preceeded by the disease in target

icd9_chapter_mapping.csv

  • ICD-9: codes, descriptions, names, chapters, and sub-chapters

outpat_males_disease_prevalence.csv

  • prevalence of each disease in the VHA-EHR database

Methods

Process Paths

  • Input: file containing disease paths
    • each patient is represented by a sequence of ICD codes, separatered by '-'
    • example (toy example, randomly generated):
650-256-526-667-650-283-101-954-589-817-820-231
508-817-630-626-526-164-965-316-191-757-643-771
458-803-502-630
292-508-458-954
820-141-601-537-879
  • Output: edge lists
    • each line contains a disease pair and the counts of patients in which the disease i preceded disease j
index,count,source,target
650-256,599,650,256
256-526,620,256,526
526-667,607,526,667
667-650,619,667,650
650-283,616,650,283
usage: process_paths.py [-h] -infile INFILE -b BIGRAM [-t TRIGRAM]

Get edge lists

optional arguments:
  -h, --help      show this help message and exit
  -infile INFILE  infile
  -b BIGRAM       output bigram
  -t TRIGRAM      output trigram (optional)

./process_paths.py -infile ../data/toy_paths.txt -b bigram.csv

Phi-coefficient and Fisher Exact Test

Calculating $\phi$ coefficient and its respective p-value

usage: compute_fisher_phi.py [-h] [-infile INFILE] [-tmp_dir TMP_DIR] [-outfile OUTFILE] [-ncpus N CPUS]

Compute phi and Fisher

optional arguments:
  -h, --help        show this help message and exit
  -infile INFILE    infile
  -tmp_dir TMP_DIR  tmp dir
  -outfile OUTFILE  outfile
  -ncpus N CPUS     number of cpus
  • infile: data/outpatient_males_cooccurrence.csv
  • outfile: output/fisher/fisher_directional_bh_fdr.csv
./compute_fisher_phi.py -infile ../data/outpatient_males_cooccurrence.csv -tmp_dir tmp/ -ncpus 10

Filter Network

Criteria to obtain the final network:

  • Remove diagnoses for which prevalence < 10th percentile
  • Remove links with < 100 patients
  • Remove links for which a disease is succeeded by a diagnosis that records death.
    • 348: Other conditions of brain (category that contains the diagnosis Brain death)
    • 656: Other known or suspected fetal and placental problems affecting management of mother (catery that contains the diagnosis Intrauterine death affecting management of mother)
    • 768: Intrauterine hypoxia and birth asphyxia
    • 798: Sudden death cause unknown

Jupyter Notebook: [../notebooks/FilterNetwork.ipynb]

  • inputs:
    • data/outpat_males_disease_prevalence.csv
    • data/outpatient_males_disease_steps.csv
    • output/fisher/fisher_directional_bh_fdr.csv
    • data/icd9_chapter_mapping.csv
  • output:
    • output/network_filtered/bigram_filtered.csv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.