Load necessary packages and extensions


In [1]:
%load_ext sql
import pandas as pd
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from collections import Counter
from __future__ import division

Get conditions data from database


In [2]:
# sql connection parameters come from connect.py
have_connect = !ls connect.py 2>/dev/null
if len(have_connect) == 0:
    !mv ../../connect.py .
from connect import *

get_ipython().magic('sql mysql://' + mysqlusername + ':' + mysqlpassword + '@' + mysqlserver + ':3306/' + mysqldbname)
conditions = %sql select nct_id, mesh_term from condition_browse
mesh_lookup = %sql select mesh_id, mesh_term from mesh_thesaurus


309589 rows affected.
54935 rows affected.

Create dictionary of conditions to list of relevant studies


In [3]:
condition_study = {}
for studyid, cond in conditions:
    if cond not in condition_study: condition_study[cond] = set()
    condition_study[cond].add(studyid)

Create dictionary of mesh_terms to mesh_id's


In [5]:
mesh_ids = {}
for id, term in mesh_lookup:
    if term not in mesh_ids: mesh_ids[term] = set()
    mesh_ids[term].add(id)

Define Jaccard similarity function


In [6]:
def jaccard_similarity(set1, set2):
    return float(len(set1 & set2)) / len(set1 | set2)

Generate distance matrix


In [7]:
max_dist = 10
condition_list = condition_study.keys()
num_cond = len(condition_list)
df = pd.DataFrame(index=condition_list, columns=condition_list, dtype=np.float32)
for i in range(num_cond):
    for j in range(num_cond):
        cond1 = condition_list[i]
        cond2 = condition_list[j]
        if i == j:
            dist = 0
        elif j < i:
            dist = df[cond2][cond1]
        elif len(condition_study[cond1] & condition_study[cond2]) > 0:
            sim = jaccard_similarity(condition_study[cond1], condition_study[cond2])
            dist = max([np.log10(sim), (-1 * max_dist)]) * -1
        else:
            dist = max_dist
        df[cond1][cond2] = dist

Cluster using DBSCAN

Iteratively create clusters


In [71]:
clus_df = df.copy()
groups = []
for i in range(50):
    db = DBSCAN(eps=(50 - i)/10.0, min_samples=2, metric='precomputed').fit(clus_df.as_matrix())
    print (50 - i) / 10.0
    cnt = Counter(db.labels_)
    if -1 in cnt and 0 in cnt and len(cnt) == 2 and cnt[-1] > cnt[0]:
        nonzero = {clus_df.index.values[i]: n for i, n in enumerate(db.labels_) if n >= 0}
    else:
        nonzero = {clus_df.index.values[i]: n for i, n in enumerate(db.labels_) if n > 0}
    for ax in [0,1]:
        clus_df.drop(nonzero.keys(), axis=ax, inplace=True)
    for c in set(nonzero.values()):
        groups.append([k for k, v in nonzero.items() if v == c])
    print cnt

singles = list(clus_df.index.values)


5.0
Counter({0.0: 3196, -1.0: 106, 1.0: 2, 2.0: 2, 3.0: 2, 4.0: 2, 5.0: 2, 6.0: 2, 7.0: 2, 8.0: 2, 9.0: 2, 10.0: 2, 11.0: 2, 12.0: 2, 13.0: 2, 14.0: 2, 15.0: 2, 16.0: 2, 17.0: 2})
4.9
Counter({0.0: 3196, -1.0: 106})
4.8
Counter({0.0: 3196, -1.0: 106})
4.7
Counter({0.0: 3196, -1.0: 106})
4.6
Counter({0.0: 3196, -1.0: 106})
4.5
Counter({0.0: 3196, -1.0: 106})
4.4
Counter({0.0: 3196, -1.0: 106})
4.3
Counter({0.0: 3196, -1.0: 106})
4.2
Counter({0.0: 3196, -1.0: 106})
4.1
Counter({0.0: 3196, -1.0: 106})
4.0
Counter({0.0: 3196, -1.0: 106})
3.9
Counter({0.0: 3196, -1.0: 106})
3.8
Counter({0.0: 3196, -1.0: 106})
3.7
Counter({0.0: 3194, -1.0: 108})
3.6
Counter({0.0: 3192, -1.0: 110})
3.5
Counter({0.0: 3190, -1.0: 112})
3.4
Counter({0.0: 3190, -1.0: 112})
3.3
Counter({0.0: 3189, -1.0: 113})
3.2
Counter({0.0: 3187, -1.0: 115})
3.1
Counter({0.0: 3182, -1.0: 117, 1.0: 3})
3.0
Counter({0.0: 3176, -1.0: 123})
2.9
Counter({0.0: 3171, -1.0: 128})
2.8
Counter({0.0: 3159, -1.0: 138, 1.0: 2})
2.7
Counter({0.0: 3147, -1.0: 148, 1.0: 2})
2.6
Counter({0.0: 3131, -1.0: 161, 1.0: 3})
2.5
Counter({0.0: 3105, -1.0: 174, 1.0: 7, 2.0: 2, 3.0: 2, 4.0: 2})
2.4
Counter({0.0: 3097, -1.0: 180, 1.0: 2})
2.3
Counter({0.0: 3068, -1.0: 205, 1.0: 2, 2.0: 2})
2.2
Counter({0.0: 3045, -1.0: 226, 1.0: 2})
2.1
Counter({0.0: 3011, -1.0: 251, 1.0: 3, 2.0: 2, 3.0: 2, 4.0: 2})
2.0
Counter({0.0: 2980, -1.0: 274, 2.0: 4, 1.0: 2, 3.0: 2})
1.9
Counter({0.0: 2926, -1.0: 315, 1.0: 3, 2.0: 2, 3.0: 2, 4.0: 2, 5.0: 2, 6.0: 2})
1.8
Counter({0.0: 2856, -1.0: 358, 5.0: 4, 1.0: 3, 2.0: 2, 3.0: 2, 4.0: 2, 6.0: 2, 7.0: 2, 8.0: 2, 9.0: 2, 10.0: 2, 11.0: 2, 12.0: 2})
1.7
Counter({0.0: 2764, -1.0: 400, 3.0: 5, 5.0: 5, 7.0: 4, 1.0: 3, 12.0: 3, 15.0: 3, 16.0: 3, 2.0: 2, 4.0: 2, 6.0: 2, 8.0: 2, 9.0: 2, 10.0: 2, 11.0: 2, 13.0: 2, 14.0: 2, 17.0: 2, 18.0: 2, 19.0: 2})
1.6
Counter({0.0: 2661, -1.0: 452, 3.0: 7, 5.0: 7, 2.0: 3, 4.0: 3, 9.0: 3, 11.0: 3, 13.0: 3, 16.0: 3, 17.0: 3, 1.0: 2, 6.0: 2, 7.0: 2, 8.0: 2, 10.0: 2, 12.0: 2, 14.0: 2, 15.0: 2})
1.5
Counter({0.0: 2452, -1.0: 541, 1.0: 15, 5.0: 9, 18.0: 8, 12.0: 6, 2.0: 5, 9.0: 5, 7.0: 4, 11.0: 4, 16.0: 4, 27.0: 4, 6.0: 3, 10.0: 3, 19.0: 3, 21.0: 3, 3.0: 2, 4.0: 2, 8.0: 2, 13.0: 2, 14.0: 2, 15.0: 2, 17.0: 2, 20.0: 2, 22.0: 2, 23.0: 2, 24.0: 2, 25.0: 2, 26.0: 2, 28.0: 2, 29.0: 2, 30.0: 2, 31.0: 2, 32.0: 2, 33.0: 2, 34.0: 2, 35.0: 2, 36.0: 2})
1.4
Counter({0.0: 2224, -1.0: 616, 2.0: 9, 14.0: 9, 5.0: 8, 10.0: 8, 20.0: 7, 7.0: 6, 11.0: 6, 37.0: 5, 8.0: 4, 13.0: 4, 21.0: 4, 41.0: 4, 1.0: 3, 6.0: 3, 16.0: 3, 23.0: 3, 32.0: 3, 34.0: 3, 35.0: 3, 42.0: 3, 43.0: 3, 3.0: 2, 4.0: 2, 9.0: 2, 12.0: 2, 15.0: 2, 17.0: 2, 18.0: 2, 19.0: 2, 22.0: 2, 24.0: 2, 25.0: 2, 26.0: 2, 27.0: 2, 28.0: 2, 29.0: 2, 30.0: 2, 31.0: 2, 33.0: 2, 36.0: 2, 38.0: 2, 39.0: 2, 40.0: 2, 44.0: 2, 45.0: 2, 46.0: 2, 47.0: 2})
1.3
Counter({0.0: 1678, -1.0: 720, 21.0: 39, 4.0: 28, 1.0: 18, 24.0: 14, 13.0: 12, 29.0: 12, 27.0: 10, 32.0: 10, 14.0: 9, 43.0: 9, 28.0: 8, 9.0: 7, 22.0: 7, 37.0: 7, 6.0: 6, 15.0: 6, 17.0: 6, 18.0: 6, 35.0: 6, 49.0: 6, 54.0: 6, 60.0: 6, 68.0: 6, 3.0: 5, 5.0: 5, 11.0: 5, 20.0: 5, 47.0: 5, 55.0: 5, 56.0: 5, 66.0: 5, 12.0: 4, 16.0: 4, 25.0: 4, 33.0: 4, 57.0: 4, 62.0: 4, 63.0: 4, 78.0: 4, 80.0: 4, 82.0: 4, 2.0: 3, 8.0: 3, 19.0: 3, 30.0: 3, 34.0: 3, 36.0: 3, 44.0: 3, 45.0: 3, 48.0: 3, 61.0: 3, 67.0: 3, 73.0: 3, 84.0: 3, 93.0: 3, 7.0: 2, 10.0: 2, 23.0: 2, 26.0: 2, 31.0: 2, 38.0: 2, 39.0: 2, 40.0: 2, 41.0: 2, 42.0: 2, 46.0: 2, 50.0: 2, 51.0: 2, 52.0: 2, 53.0: 2, 58.0: 2, 59.0: 2, 64.0: 2, 65.0: 2, 69.0: 2, 70.0: 2, 71.0: 2, 72.0: 2, 74.0: 2, 75.0: 2, 76.0: 2, 77.0: 2, 79.0: 2, 81.0: 2, 83.0: 2, 85.0: 2, 86.0: 2, 87.0: 2, 88.0: 2, 89.0: 2, 90.0: 2, 91.0: 2, 92.0: 2})
1.2
Counter({5.0: 987, -1.0: 809, 10.0: 40, 6.0: 29, 35.0: 25, 12.0: 18, 0.0: 17, 13.0: 17, 39.0: 17, 36.0: 16, 3.0: 15, 7.0: 15, 21.0: 13, 19.0: 11, 22.0: 11, 46.0: 11, 1.0: 10, 17.0: 10, 4.0: 9, 15.0: 9, 49.0: 9, 9.0: 8, 27.0: 8, 45.0: 8, 43.0: 7, 79.0: 7, 80.0: 7, 11.0: 6, 14.0: 6, 29.0: 6, 34.0: 6, 47.0: 6, 75.0: 6, 77.0: 6, 16.0: 5, 18.0: 5, 28.0: 5, 37.0: 5, 41.0: 5, 42.0: 5, 56.0: 5, 58.0: 5, 63.0: 5, 67.0: 5, 78.0: 5, 2.0: 4, 20.0: 4, 30.0: 4, 33.0: 4, 48.0: 4, 51.0: 4, 52.0: 4, 60.0: 4, 69.0: 4, 70.0: 4, 74.0: 4, 76.0: 4, 88.0: 4, 89.0: 4, 23.0: 3, 26.0: 3, 50.0: 3, 55.0: 3, 59.0: 3, 62.0: 3, 66.0: 3, 71.0: 3, 72.0: 3, 73.0: 3, 81.0: 3, 82.0: 3, 84.0: 3, 86.0: 3, 87.0: 3, 93.0: 3, 95.0: 3, 99.0: 3, 8.0: 2, 24.0: 2, 25.0: 2, 31.0: 2, 32.0: 2, 38.0: 2, 40.0: 2, 44.0: 2, 53.0: 2, 54.0: 2, 57.0: 2, 61.0: 2, 64.0: 2, 65.0: 2, 68.0: 2, 83.0: 2, 85.0: 2, 90.0: 2, 91.0: 2, 92.0: 2, 94.0: 2, 96.0: 2, 97.0: 2, 98.0: 2})
1.1
Counter({-1.0: 811, 0.0: 15})
1.0
Counter({-1.0: 811})
0.9
Counter({-1.0: 811})
0.8
Counter({-1.0: 811})
0.7
Counter({-1.0: 811})
0.6
Counter({-1.0: 811})
0.5
Counter({-1.0: 811})
0.4
Counter({-1.0: 811})
0.3
Counter({-1.0: 811})
0.2
Counter({-1.0: 811})
0.1
Counter({-1.0: 811})

Evaluate coherence of clusters


In [68]:
# reverse lookup of second-level MeSH categories
mesh_cats = {v2[0]: k2 for k2, v2 in [(k1, [i for i in v1 if len(i) == 7]) for k1, v1 in mesh_ids.items()] if len(v2) > 0}

# function to produce counts of MeSH categories
def mesh_summary(cond_list):
    mesh_list = Counter()
    for c in cond_list:
        for m in mesh_ids[c]:
            if len(m) >= 7 and m[:7] in mesh_cats:
                mesh_list[mesh_cats[m[:7]]] += 1
    return mesh_list

In [73]:
for g in groups:
    print g
    print mesh_summary(g)


['Bartonella Infections', 'Cat-Scratch Disease']
Counter({'Bacterial Infections': 3, 'Lymphatic Diseases': 1})
['Myokymia', 'Isaacs Syndrome']
Counter({'Neuromuscular Diseases': 2, 'Muscular Diseases': 1, 'Neurologic Manifestations': 1, 'Signs and Symptoms': 1})
['Paraneoplastic Syndromes', 'Paraneoplastic Syndromes, Nervous System']
Counter({'Paraneoplastic Syndromes': 2, 'Neurodegenerative Diseases': 1, 'Neoplasms by Site': 1})
['Decompression Sickness', 'Barotrauma']
Counter({'Barotrauma': 2})
['Ochronosis', 'Alkaptonuria']
Counter({'Pathologic Processes': 1, 'Genetic Diseases, Inborn': 1, 'Metabolic Diseases': 1})
['Xanthomatosis, Cerebrotendinous', 'Xanthomatosis']
Counter({'Metabolic Diseases': 3, 'Genetic Diseases, Inborn': 1})
['Typhus, Epidemic Louse-Borne', 'Scrub Typhus']
Counter({'Bacterial Infections': 2})
["Legionnaires' Disease", 'Legionellosis']
Counter({'Respiratory Tract Infections': 2, 'Bacterial Infections': 2})
['Lichen Sclerosus et Atrophicus', 'Vulvar Lichen Sclerosus']
Counter({'Skin Diseases': 1, 'Female Urogenital Diseases': 1})
['Lambert-Eaton Myasthenic Syndrome', 'Myasthenic Syndromes, Congenital']
Counter({'Autoimmune Diseases': 2, 'Neuromuscular Diseases': 2, 'Autoimmune Diseases of the Nervous System': 1, 'Genetic Diseases, Inborn': 1, 'Neurodegenerative Diseases': 1, 'Paraneoplastic Syndromes': 1, 'Neoplasms by Site': 1})
['Tooth Attrition', 'Tooth Wear']
Counter({'Tooth Diseases': 2})
['Hidradenitis Suppurativa', 'Hidradenitis']
Counter({'Skin Diseases': 3, 'Infection': 2, 'Bacterial Infections': 1})
['Yaws', 'Treponemal Infections']
Counter({'Bacterial Infections': 5, 'Skin Diseases': 1, 'Infection': 1})
['Tooth, Nonvital', 'Tooth Fractures']
Counter({'Tooth Diseases': 2, 'Tooth Injuries': 1})
['Hantavirus Infections', 'Hantavirus Pulmonary Syndrome']
Counter({'RNA Virus Infections': 2, 'Respiration Disorders': 1})
['Osteoma', 'Osteoma, Osteoid']
Counter({'Neoplasms by Histologic Type': 2})
['Polyradiculopathy', 'Glanders']
Counter({'Neuromuscular Diseases': 1, 'Bacterial Infections': 1, 'Horse Diseases': 1})
['Asbestosis', 'Pneumoconiosis', 'Silicosis']
Counter({'Lung Diseases': 6, 'Pneumoconiosis': 3})
['Enophthalmos', 'Diplopia']
Counter({'Orbital Diseases': 1, 'Neurologic Manifestations': 1, 'Signs and Symptoms': 1, 'Vision Disorders': 1})
['Pallister-Hall Syndrome', 'Polydactyly']
Counter({'Congenital Abnormalities': 3, 'Musculoskeletal Abnormalities': 2, 'Central Nervous System Diseases': 2, 'Nervous System Neoplasms': 1, 'Hamartoma': 1, 'Neoplasms by Site': 1})
['Korsakoff Syndrome', 'Wernicke Encephalopathy', 'Alcohol Amnestic Disorder']
Counter({'Substance-Related Disorders': 3, 'Alcohol-Related Disorders': 3, 'Delirium, Dementia, Amnestic, Cognitive Disorders': 2, 'Poisoning': 2, 'Neurotoxicity Syndromes': 2, 'Nutrition Disorders': 1, 'Metabolic Diseases': 1, 'Neurologic Manifestations': 1, 'Central Nervous System Diseases': 1, 'Neurobehavioral Manifestations': 1, 'Signs and Symptoms': 1})
['Tinea', 'Tinea Pedis', 'Tinea Versicolor', 'Onycholysis', 'Tinea Capitis', 'Dermatomycoses', 'Onychomycosis']
Counter({'Skin Diseases': 10, 'Mycoses': 6, 'Infection': 6, 'Signs and Symptoms': 1})
['Parvoviridae Infections', 'Erythema Infectiosum']
Counter({'Skin Diseases': 2, 'DNA Virus Infections': 2, 'Skin Diseases, Viral': 1})
['Neurodermatitis', 'Prurigo']
Counter({'Skin Diseases': 3})
['Hypertelorism', 'Hyperostosis']
Counter({'Bone Diseases': 2, 'Congenital Abnormalities': 1, 'Musculoskeletal Abnormalities': 1})
['Heat Exhaustion', 'Heat Stroke']
Counter({'Heat Stress Disorders': 2})
['Gingival Recession', 'Periodontal Atrophy']
Counter({'Mouth Diseases': 3})
['Gingival Overgrowth', 'Gingival Hyperplasia']
Counter({'Mouth Diseases': 2})
['Sialadenitis', 'Retroperitoneal Fibrosis']
Counter({'Pathologic Processes': 1, 'Mouth Diseases': 1})
['Budd-Chiari Syndrome', 'Hepatic Veno-Occlusive Disease', 'Pulmonary Veno-Occlusive Disease']
Counter({'Vascular Diseases': 3, 'Liver Diseases': 2, 'Lung Diseases': 1})
['Hordeolum', 'Chalazion']
Counter({'Eyelid Diseases': 2, 'Cysts': 1, 'Bacterial Infections': 1, 'Eye Infections': 1, 'Infection': 1})
['Coronary Aneurysm', 'Mucocutaneous Lymph Node Syndrome']
Counter({'Vascular Diseases': 3, 'Lymphatic Diseases': 1, 'Skin Diseases': 1, 'Heart Diseases': 1})
['Nail Diseases', 'Nails, Ingrown']
Counter({'Skin Diseases': 2})
['Psychoses, Substance-Induced', 'Shared Paranoid Disorder']
Counter({'Schizophrenia and Disorders with Psychotic Features': 2, 'Psychoses, Substance-Induced': 1, 'Poisoning': 1, 'Substance-Related Disorders': 1})
['Pityriasis Rosea', 'Pityriasis', 'Dermatitis, Exfoliative', 'Pityriasis Rubra Pilaris']
Counter({'Skin Diseases': 5})
['Anterior Compartment Syndrome', 'Compartment Syndromes']
Counter({'Vascular Diseases': 2, 'Muscular Diseases': 2})
['Sleep Bruxism', 'Bruxism', 'Airway Remodeling']
Counter({'Tooth Diseases': 2, 'Pathological Conditions, Anatomical': 1, 'Respiratory Physiological Phenomena': 1, 'Sleep Disorders': 1})
['Sweating, Gustatory', 'Parotid Neoplasms']
Counter({'Mouth Diseases': 3, 'Skin Diseases': 1, 'Autonomic Nervous System Diseases': 1, 'Neoplasms by Site': 1})
['Placenta Accreta', 'Placenta Previa']
Counter({'Pregnancy Complications': 4})
['Gas Gangrene', 'Anthrax']
Counter({'Bacterial Infections': 2})
['Spermatic Cord Torsion', 'Torsion Abnormality']
Counter({'Pathological Conditions, Anatomical': 1, 'Genital Diseases, Male': 1})
['Scleritis', 'Orbital Diseases']
Counter({'Orbital Diseases': 1, 'Scleral Diseases': 1})
['Tumor Lysis Syndrome', 'Gout', 'Hyperuricemia']
Counter({'Rheumatic Diseases': 1, 'Metabolic Diseases': 1, 'Genetic Diseases, Inborn': 1, 'Joint Diseases': 1, 'Pathologic Processes': 1, 'Lymphatic Diseases': 1, 'Immunoproliferative Disorders': 1})
['Kidney Tubular Necrosis, Acute', 'Kidney Cortex Necrosis']
Counter({'Female Urogenital Diseases': 2, 'Urologic Diseases': 2})
['Candidiasis, Chronic Mucocutaneous', 'Polyendocrinopathies, Autoimmune']
Counter({'Mycoses': 2, 'Autoimmune Diseases': 1, 'Skin Diseases': 1, 'Infection': 1, 'Polyendocrinopathies, Autoimmune': 1})
['Alopecia', 'Alopecia Areata']
Counter({'Skin Diseases': 2, 'Pathological Conditions, Anatomical': 1})
['Vaccinia', 'Poxviridae Infections', 'Monkeypox', 'Smallpox']
Counter({'DNA Virus Infections': 4, 'Rodent Diseases': 1, 'Primate Diseases': 1})
['Magnesium Deficiency', 'Calcium Metabolism Disorders']
Counter({'Metabolic Diseases': 1, 'Nutrition Disorders': 1})
['Bites and Stings', 'Insect Bites and Stings']
Counter({'Poisoning': 2, 'Bites and Stings': 1})
['Drug Toxicity', 'Iatrogenic Disease']
Counter({'Poisoning': 1, 'Pathologic Processes': 1})
['Echinococcosis, Hepatic', 'Echinococcosis']
Counter({'Helminthiasis': 2, 'Liver Diseases, Parasitic': 1, 'Liver Diseases': 1})
['Eye Burns', 'Burns, Chemical']
Counter({'Burns': 2, 'Craniocerebral Trauma': 1})
['Iris Neoplasms', 'Choroid Neoplasms']
Counter({'Uveal Diseases': 4, 'Eye Neoplasms': 2, 'Neoplasms by Site': 2})
['Mandibular Fractures', 'Mandibular Injuries']
Counter({'Craniocerebral Trauma': 2, 'Fractures, Bone': 1})
['Birth Injuries', 'Facial Neoplasms', 'Head Injuries, Penetrating']
Counter({'Craniocerebral Trauma': 1, 'Infant, Newborn, Diseases': 1, 'Wounds, Penetrating': 1, 'Trauma, Nervous System': 1, 'Birth Injuries': 1, 'Neoplasms by Site': 1})
['Lipodystrophy', 'HIV-Associated Lipodystrophy Syndrome']
Counter({'Metabolic Diseases': 4, 'Skin Diseases': 2, 'Sexually Transmitted Diseases': 1, 'RNA Virus Infections': 1, 'Immunologic Deficiency Syndromes': 1})
['Osteochondroma', 'Exostoses, Multiple Hereditary', 'Osteophyte', 'Osteochondromatosis', 'Exostoses']
Counter({'Bone Diseases': 6, 'Neoplasms by Histologic Type': 3, 'Genetic Diseases, Inborn': 1, 'Neoplastic Syndromes, Hereditary': 1})
['Muscle Cramp', 'Sleep-Wake Transition Disorders']
Counter({'Sleep Disorders': 1, 'Muscular Diseases': 1, 'Neurologic Manifestations': 1, 'Signs and Symptoms': 1})
['Hallux Limitus', 'Arthralgia', 'Hallux Varus', 'Hallux Rigidus', 'Hallux Valgus']
Counter({'Foot Deformities': 4, 'Joint Diseases': 3, 'Nervous System Physiological Phenomena': 1, 'Signs and Symptoms': 1, 'Psychophysiology': 1})
['Siderosis', 'Cerebral Amyloid Angiopathy']
Counter({'Lung Diseases': 2, 'Vascular Diseases': 1, 'Central Nervous System Diseases': 1, 'Pneumoconiosis': 1, 'Metabolic Diseases': 1})
['Polyuria', 'Enuresis', 'Nocturia', 'Nocturnal Enuresis']
Counter({'Female Urogenital Diseases': 3, 'Urologic Diseases': 3, 'Behavior': 2, 'Signs and Symptoms': 2, 'Mental Disorders Diagnosed in Childhood': 2})
['Positive-Pressure Respiration, Intrinsic', 'Lung, Hyperlucent']
Counter({'Lung Diseases': 1, 'Respiration Disorders': 1})
['Anemia, Dyserythropoietic, Congenital', 'Spherocytosis, Hereditary']
Counter({'Genetic Diseases, Inborn': 2, 'Hematologic Diseases': 2})
['Frasier Syndrome', 'Denys-Drash Syndrome']
Counter({'Female Urogenital Diseases': 5, 'Congenital Abnormalities': 2, 'Gonadal Disorders': 2, 'Genetic Diseases, Inborn': 2, 'Urologic Diseases': 2, 'Urogenital Abnormalities': 2, 'Urogenital Neoplasms': 1, 'Neoplastic Syndromes, Hereditary': 1, 'Neoplasms by Histologic Type': 1, 'Neoplasms by Site': 1})
['Encopresis', 'Fecal Incontinence']
Counter({'Gastrointestinal Diseases': 1, 'Behavior': 1, 'Mental Disorders Diagnosed in Childhood': 1, 'Signs and Symptoms': 1})
['Tachycardia, Paroxysmal', 'Pre-Excitation Syndromes', 'Wolff-Parkinson-White Syndrome']
Counter({'Heart Diseases': 3, 'Pathologic Processes': 1, 'Congenital Abnormalities': 1})
['Hyperalgesia', 'Sunburn']
Counter({'Burns': 1, 'Neurologic Manifestations': 1, 'Signs and Symptoms': 1, 'Skin Diseases': 1})
['Intestinal Atresia', 'Gastroschisis']
Counter({'Congenital Abnormalities': 2, 'Pathological Conditions, Anatomical': 1, 'Gastrointestinal Diseases': 1, 'Musculoskeletal Abnormalities': 1, 'Digestive System Abnormalities': 1})
['Colitis, Lymphocytic', 'Colitis, Microscopic', 'Colitis, Collagenous']
Counter({'Gastrointestinal Diseases': 6})
['Central Nervous System Infections', 'West Nile Fever', 'Listeriosis']
Counter({'Central Nervous System Diseases': 3, 'RNA Virus Infections': 2, 'Central Nervous System Infections': 1, 'Arbovirus Infections': 1, 'Encephalitis, Viral': 1, 'Bacterial Infections': 1, 'Central Nervous System Viral Diseases': 1})
['Fluorosis, Dental', 'Fluoride Poisoning']
Counter({'Tooth Diseases': 1, 'Poisoning': 1})
['Jaw Abnormalities', 'Facial Asymmetry']
Counter({'Congenital Abnormalities': 2, 'Stomatognathic System Abnormalities': 1, 'Jaw Diseases': 1, 'Musculoskeletal Abnormalities': 1, 'Pathological Conditions, Anatomical': 1})
['Inert Gas Narcosis', 'Stupor']
Counter({'Poisoning': 1, 'Neurologic Manifestations': 1, 'Inert Gas Narcosis': 1, 'Signs and Symptoms': 1})
['Intestinal Pseudo-Obstruction', 'Ileus']
Counter({'Gastrointestinal Diseases': 2})
['Bronchiolitis, Viral', 'Bronchiolitis', 'Bronchiolitis Obliterans']
Counter({'Lung Diseases': 3, 'Bronchial Diseases': 3, 'Respiratory Tract Infections': 2, 'Bronchiolitis, Viral': 1})
['Schizophrenia, Catatonic', 'Schizophrenia, Paranoid', 'Catatonia', 'Hallucinations', 'Schizophrenia, Disorganized', 'Delusions', 'Paranoid Disorders']
Counter({'Schizophrenia and Disorders with Psychotic Features': 4, 'Neurologic Manifestations': 2, 'Neurobehavioral Manifestations': 2, 'Signs and Symptoms': 2, 'Behavior': 2})
['Ebstein Anomaly', 'Double Outlet Right Ventricle', 'Truncus Arteriosus, Persistent']
Counter({'Congenital Abnormalities': 3, 'Cardiovascular Abnormalities': 3, 'Heart Diseases': 3})
['Bulimia', 'Anorexia Nervosa', 'Binge-Eating Disorder', 'Bulimia Nervosa', 'Eating Disorders', 'Cachexia', 'Anorexia']
Counter({'Eating Disorders': 4, 'Signs and Symptoms': 3})
['Orbital Cellulitis', 'Orbital Fractures']
Counter({'Orbital Diseases': 1, 'Connective Tissue Diseases': 1, 'Fractures, Bone': 1, 'Craniocerebral Trauma': 1})
['Cholera', 'Vibrio Infections']
Counter({'Bacterial Infections': 2})
['Tuberculosis, Osteoarticular', 'Tuberculosis, Lymph Node']
Counter({'Bacterial Infections': 2, 'Lymphatic Diseases': 2, 'Bone Diseases': 1, 'Infection': 1})
['Malaria', 'Malaria, Falciparum', 'Malaria, Vivax']
Counter({'Protozoan Infections': 3})
['Lymphadenitis', 'Histiocytic Necrotizing Lymphadenitis']
Counter({'Lymphatic Diseases': 2})
['Asthma, Exercise-Induced', 'Bronchial Spasm', 'Respiratory Sounds']
Counter({'Bronchial Diseases': 2, 'Respiratory Physiological Phenomena': 1, 'Hypersensitivity': 1, 'Diagnostic Techniques and Procedures': 1, 'Respiratory Hypersensitivity': 1, 'Signs and Symptoms': 1})
['Habits', 'Food Habits']
Counter({'Behavior': 3})
['Nerve Degeneration', 'Pantothenate Kinase-Associated Neurodegeneration', 'Neuroaxonal Dystrophies']
Counter({'Central Nervous System Diseases': 4, 'Pathologic Processes': 1, 'Neurodegenerative Diseases': 1, 'Genetic Diseases, Inborn': 1})
['Tooth Discoloration', 'Dental Calculus']
Counter({'Tooth Diseases': 2, 'Pathological Conditions, Anatomical': 1})
['Stress Disorders, Traumatic, Acute', 'Fractures, Stress']
Counter({'Fractures, Bone': 1, 'Anxiety Disorders': 1})
['Hot Flashes', 'Flushing', 'Hyperemia']
Counter({'Signs and Symptoms': 2, 'Vascular Diseases': 1})
['Myoglobinuria', 'Neuroleptic Malignant Syndrome', 'Rhabdomyolysis']
Counter({'Muscular Diseases': 2, 'Poisoning': 1, 'Central Nervous System Diseases': 1, 'Neurotoxicity Syndromes': 1})
['Behavior, Addictive', 'Cocaine-Related Disorders', 'Alcohol-Related Disorders', 'Tobacco Use Disorder', 'Alcohol-Induced Disorders, Nervous System', 'Alcoholism', 'Alcohol Drinking', 'Opioid-Related Disorders', 'Substance-Related Disorders', 'Neurobehavioral Manifestations', 'Smoking', 'Alcoholic Intoxication', 'Substance Abuse, Intravenous', 'Heroin Dependence', 'Alcohol-Induced Disorders']
Counter({'Substance-Related Disorders': 9, 'Alcohol-Related Disorders': 5, 'Behavior': 3, 'Opioid-Related Disorders': 2, 'Substance Abuse, Intravenous': 1, 'Neurologic Manifestations': 1, 'Tobacco Use Disorder': 1, 'Neurobehavioral Manifestations': 1, 'Cocaine-Related Disorders': 1, 'Signs and Symptoms': 1, 'Poisoning': 1, 'Neurotoxicity Syndromes': 1})
['Epidermal Necrolysis, Toxic', 'Pemphigoid, Bullous', 'Stevens-Johnson Syndrome', 'Pemphigoid, Benign Mucous Membrane', 'Staphylococcal Scalded Skin Syndrome']
Counter({'Skin Diseases': 6, 'Bacterial Infections': 2, 'Conjunctival Diseases': 1, 'Autoimmune Diseases': 1, 'Infection': 1, 'Hypersensitivity': 1, 'Mouth Diseases': 1, 'Poisoning': 1})
['Diabetes, Gestational', 'Pregnancy in Diabetics']
Counter({'Pregnancy Complications': 2, 'Diabetes Mellitus': 1, 'Metabolic Diseases': 1})
['Lichen Planus, Oral', 'Lichen Planus']
Counter({'Skin Diseases': 2, 'Mouth Diseases': 1})
['Erythema', 'Lyme Disease', 'Borrelia Infections', 'Glossitis, Benign Migratory', 'Tick-Borne Diseases', 'Erythema Chronicum Migrans', 'Rosacea', 'Lyme Neuroborreliosis', 'Anaplasmosis']
Counter({'Bacterial Infections': 16, 'Skin Diseases': 4, 'Anaplasmosis': 1, 'Arbovirus Infections': 1, 'Infection': 1, 'Central Nervous System Diseases': 1, 'Mouth Diseases': 1, 'Protozoan Infections': 1})
['Jaw, Edentulous', 'Jaw, Edentulous, Partially', 'Mouth, Edentulous']
Counter({'Tooth Diseases': 3, 'Mouth Diseases': 3, 'Jaw Diseases': 2})
['Apnea', 'Sleep Apnea, Obstructive', 'Sleep Apnea Syndromes', 'Respiratory Aspiration']
Counter({'Respiration Disorders': 4, 'Sleep Disorders': 2, 'Signs and Symptoms': 1, 'Pathologic Processes': 1})
['Glaucoma, Neovascular', 'Glaucoma, Angle-Closure']
Counter({'Ocular Hypertension': 2})
['Leprosy', 'Erythema Nodosum', 'Leprosy, Lepromatous', 'Leprosy, Multibacillary', 'Leprosy, Borderline']
Counter({'Bacterial Infections': 4, 'Skin Diseases': 2, 'Hypersensitivity': 1, 'Poisoning': 1})
['Neurocysticercosis', 'Taeniasis', 'Cysticercosis']
Counter({'Helminthiasis': 3, 'Central Nervous System Diseases': 1, 'Central Nervous System Parasitic Infections': 1})
['Sexual Dysfunctions, Psychological', 'Sexual Dysfunction, Physiological', 'Erectile Dysfunction', 'Hypokinesia']
Counter({'Sexual and Gender Disorders': 2, 'Genital Diseases, Male': 2, 'Female Urogenital Diseases': 1, 'Neurologic Manifestations': 1, 'Signs and Symptoms': 1})
['Epidermolysis Bullosa Dystrophica', 'Epidermolysis Bullosa Simplex', 'Epidermolysis Bullosa, Junctional', 'Nails, Malformed', 'Pachyonychia Congenita', 'Epidermolysis Bullosa']
Counter({'Skin Diseases': 15, 'Congenital Abnormalities': 5, 'Genetic Diseases, Inborn': 5, 'Connective Tissue Diseases': 1, 'Pathological Conditions, Anatomical': 1})
['Panniculitis', 'Enteropathy-Associated T-Cell Lymphoma']
Counter({'Connective Tissue Diseases': 1, 'Skin Diseases': 1, 'Immunoproliferative Disorders': 1, 'Neoplasms by Histologic Type': 1, 'Lymphatic Diseases': 1})
['Compulsive Personality Disorder', 'Obsessive-Compulsive Disorder']
Counter({'Anxiety Disorders': 1, 'Personality Disorders': 1})
['Scurvy', 'Ascorbic Acid Deficiency']
Counter({'Nutrition Disorders': 2, 'Vascular Diseases': 1, 'Hematologic Diseases': 1})
['Leishmaniasis', 'Leishmaniasis, Cutaneous', 'Leishmaniasis, Mucocutaneous', 'Leishmaniasis, Visceral']
Counter({'Protozoan Infections': 4, 'Skin Diseases': 3, 'Skin Diseases, Parasitic': 3})
['Psychomotor Agitation', 'Restless Legs Syndrome']
Counter({'Sleep Disorders': 2, 'Neurologic Manifestations': 2, 'Signs and Symptoms': 2, 'Neurobehavioral Manifestations': 1})
['Schizotypal Personality Disorder', 'Borderline Personality Disorder', 'Impulse Control Disorders', 'Personality Disorders', 'Dysthymic Disorder', 'Antisocial Personality Disorder', 'Psychophysiologic Disorders', 'Adjustment Disorders']
Counter({'Personality Disorders': 4, 'Impulse Control Disorders': 1, 'Mood Disorders': 1, 'Adjustment Disorders': 1, 'Signs and Symptoms': 1})
['Vomiting', 'Nausea', 'Postoperative Nausea and Vomiting']
Counter({'Signs and Symptoms': 4, 'Pathologic Processes': 1})
['Back Pain', 'Low Back Pain']
Counter({'Signs and Symptoms': 4, 'Neurologic Manifestations': 2})
['Skin Diseases, Vascular', 'Striae Distensae', 'Livedo Reticularis']
Counter({'Skin Diseases': 2, 'Signs and Symptoms': 2, 'Vascular Diseases': 1})
['Pelvic Infection', 'Pelvic Inflammatory Disease']
Counter({'Infection': 2, 'Female Urogenital Diseases': 1})
['Arteriosclerosis Obliterans', 'Thromboangiitis Obliterans']
Counter({'Vascular Diseases': 3})
['Substance Withdrawal Syndrome', 'Morphine Dependence']
Counter({'Substance-Related Disorders': 2, 'Substance Withdrawal Syndrome': 1, 'Opioid-Related Disorders': 1})
['Anuria', 'Pneumoperitoneum']
Counter({'Female Urogenital Diseases': 2, 'Urologic Diseases': 2, 'Peritoneal Diseases': 1})
['Hemorrhagic Fever, Crimean', 'Lassa Fever']
Counter({'RNA Virus Infections': 4, 'Arbovirus Infections': 1})
['Aphakia', 'Lens Diseases', 'Pseudophakia', 'Capsule Opacification']
Counter({'Lens Diseases': 3, 'Signs and Symptoms': 1})
['Uterine Diseases', 'Uterine Cervical Diseases']
Counter({'Female Urogenital Diseases': 2})
['Hemianopsia', 'Scotoma']
Counter({'Neurologic Manifestations': 2, 'Signs and Symptoms': 2, 'Vision Disorders': 2})
['Marijuana Smoking', 'Marijuana Abuse']
Counter({'Substance-Related Disorders': 1, 'Marijuana Abuse': 1, 'Behavior': 1})
['Precursor B-Cell Lymphoblastic Leukemia-Lymphoma', 'Leukemia, Biphenotypic, Acute']
Counter({'Lymphatic Diseases': 2, 'Immunoproliferative Disorders': 2, 'Neoplasms by Histologic Type': 2})
['Myocardial Stunning', 'Takotsubo Cardiomyopathy']
Counter({'Heart Diseases': 3, 'Vascular Diseases': 2})
['Proctocolitis', 'Proctitis']
Counter({'Gastrointestinal Diseases': 7})
['Hip Injuries', 'Wrist Injuries']
Counter({'Hip Injuries': 1, 'Arm Injuries': 1})
['Dupuytren Contracture', 'Contracture']
Counter({'Muscular Diseases': 2, 'Connective Tissue Diseases': 1, 'Joint Diseases': 1})
['Nasal Obstruction', 'Sneezing']
Counter({'Respiratory Physiological Phenomena': 1, 'Respiration Disorders': 1, 'Signs and Symptoms': 1, 'Nose Diseases': 1})
['Periventricular Nodular Heterotopia', 'Malformations of Cortical Development', 'Choristoma']
Counter({'Congenital Abnormalities': 2, 'Nervous System Malformations': 2, 'Pathological Conditions, Anatomical': 1})
['Vitreoretinopathy, Proliferative', 'Dissociative Disorders', 'Conjunctival Diseases', 'Vitreous Detachment', 'Retinal Perforations', 'Conversion Disorder', 'Epiretinal Membrane', 'Retinal Detachment', 'Hysteria']
Counter({'Retinal Diseases': 4, 'Dissociative Disorders': 1, 'Conjunctival Diseases': 1, 'Vitreoretinopathy, Proliferative': 1, 'Personality Disorders': 1, 'Vitreous Detachment': 1, 'Somatoform Disorders': 1})
['Amnesia', 'Memory Disorders']
Counter({'Neurologic Manifestations': 2, 'Signs and Symptoms': 2, 'Neurobehavioral Manifestations': 2, 'Delirium, Dementia, Amnestic, Cognitive Disorders': 1})
['Abortion, Missed', 'Abortion, Incomplete']
Counter({'Pregnancy Complications': 2})
['Herpes Zoster Ophthalmicus', 'Keratitis', 'Eye Infections', 'Corneal Ulcer', 'Eye Infections, Bacterial', 'Eye Infections, Fungal', 'Blepharitis', 'Keratitis, Herpetic']
Counter({'Eye Infections': 6, 'Infection': 4, 'Corneal Diseases': 3, 'DNA Virus Infections': 2, 'Eye Infections, Viral': 2, 'Eyelid Diseases': 1, 'Bacterial Infections': 1, 'Mycoses': 1})
['Suicidal Ideation', 'Suicide, Attempted', 'Suicide']
Counter({'Sociology': 3, 'Behavior': 3})
['Bursitis', 'Periarthritis', 'Shoulder Pain', 'Shoulder Impingement Syndrome', 'Tendinopathy', 'Neck Pain']
Counter({'Joint Diseases': 5, 'Signs and Symptoms': 4, 'Muscular Diseases': 1, 'Neurologic Manifestations': 1, 'Tendon Injuries': 1})
['Coccidioidomycosis', 'Rift Valley Fever', 'Meningitis, Fungal', 'Coccidiosis']
Counter({'Mycoses': 2, 'Central Nervous System Diseases': 2, 'RNA Virus Infections': 2, 'Arbovirus Infections': 1, 'Liver Diseases': 1, 'Protozoan Infections': 1, 'Hepatitis, Animal': 1, 'Hepatitis, Viral, Animal': 1})
['Hydrocephalus, Normal Pressure', 'Hydrocephalus']
Counter({'Central Nervous System Diseases': 3})
['Salivary Gland Diseases', "Sjogren's Syndrome", 'Lacrimal Apparatus Diseases', 'Xerostomia', 'Lacrimal Duct Obstruction', 'Ectropion', 'Dacryocystitis', 'Radiation Injuries']
Counter({'Lacrimal Apparatus Diseases': 4, 'Mouth Diseases': 3, 'Eyelid Diseases': 1, 'Rheumatic Diseases': 1, 'Autoimmune Diseases': 1, 'Public Health': 1, 'Joint Diseases': 1, 'Radiation Injuries': 1, 'Connective Tissue Diseases': 1})
['Occupational Diseases', 'Neurogenic Bowel', 'Spinal Injuries', 'Neck Injuries', 'Arm Injuries', 'Back Injuries']
Counter({'Back Injuries': 2, 'Neck Injuries': 1, 'Arm Injuries': 1, 'Gastrointestinal Diseases': 1, 'Spinal Injuries': 1})
['Female Athlete Triad Syndrome', 'Menstruation Disturbances']
Counter({'Pathologic Processes': 1, 'Bone Diseases': 1, 'Eating Disorders': 1, 'Gonadal Disorders': 1})
['Brain Death', 'Cadaver', 'Cerebral Hemorrhage, Traumatic', 'Brain Hemorrhage, Traumatic']
Counter({'Central Nervous System Diseases': 6, 'Trauma, Nervous System': 4, 'Vascular Diseases': 3, 'Craniocerebral Trauma': 2, 'Pathologic Processes': 2, 'Neurologic Manifestations': 1})
['Corneal Dystrophies, Hereditary', 'Miosis', 'Mydriasis', 'Dilatation, Pathologic', "Fuchs' Endothelial Dystrophy", 'Iridocorneal Endothelial Syndrome', 'Corneal Edema', 'Corneal Diseases', 'Keratoconus']
Counter({'Corneal Diseases': 6, 'Genetic Diseases, Inborn': 2, 'Pupil Disorders': 2, 'Eye Diseases, Hereditary': 2, 'Pathological Conditions, Anatomical': 1, 'Neurologic Manifestations': 1, 'Signs and Symptoms': 1, 'Uveal Diseases': 1})
['Endophthalmitis', 'Ophthalmia Neonatorum']
Counter({'Bacterial Infections': 2, 'Eye Infections': 2, 'Infection': 2, 'Infant, Newborn, Diseases': 1, 'Conjunctival Diseases': 1})
['Amyloidosis, Familial', 'Amyloid Neuropathies', 'Amyloid Neuropathies, Familial']
Counter({'Metabolic Diseases': 6, 'Genetic Diseases, Inborn': 3, 'Neuromuscular Diseases': 2, 'Neurodegenerative Diseases': 1})
['Pyruvate Carboxylase Deficiency Disease', 'Protein Deficiency']
Counter({'Metabolic Diseases': 4, 'Genetic Diseases, Inborn': 2, 'Central Nervous System Diseases': 1, 'Nutrition Disorders': 1})
['HIV Wasting Syndrome', 'Wasting Syndrome']
Counter({'Metabolic Diseases': 2, 'Nutrition Disorders': 2, 'Sexually Transmitted Diseases': 1, 'RNA Virus Infections': 1, 'Immunologic Deficiency Syndromes': 1})
['Prediabetic State', 'Glucose Intolerance']
Counter({'Metabolic Diseases': 2, 'Diabetes Mellitus': 1})
['Nematode Infections', 'Ascariasis', 'Trichuriasis', 'Strongyloidiasis', 'Hookworm Infections', 'Ascaridiasis', 'Ancylostomiasis']
Counter({'Helminthiasis': 7})
['Asthenia', 'Myasthenia Gravis', 'Muscle Weakness', 'Paresis']
Counter({'Signs and Symptoms': 3, 'Neurologic Manifestations': 2, 'Autoimmune Diseases of the Nervous System': 1, 'Muscular Diseases': 1, 'Autoimmune Diseases': 1, 'Neuromuscular Diseases': 1, 'Pathologic Processes': 1})
['Cheyne-Stokes Respiration', 'Sleep Apnea, Central']
Counter({'Respiration Disorders': 2, 'Sleep Disorders': 1, 'Signs and Symptoms': 1})
['Vitamin E Deficiency', 'Night Blindness', 'Vitamin A Deficiency']
Counter({'Nutrition Disorders': 2, 'Vision Disorders': 1})
['Abortion, Habitual', 'Abortion, Spontaneous']
Counter({'Pregnancy Complications': 2})
['Arthritis, Gouty', 'Chondrocalcinosis']
Counter({'Joint Diseases': 2, 'Metabolic Diseases': 1, 'Rheumatic Diseases': 1, 'Genetic Diseases, Inborn': 1})
['Ileitis', 'Pouchitis']
Counter({'Gastrointestinal Diseases': 6})
['RNA Virus Infections', 'Respiratory Tract Diseases']
Counter({'RNA Virus Infections': 1})
['Failed Back Surgery Syndrome', 'Pain, Intractable']
Counter({'Neurologic Manifestations': 2, 'Signs and Symptoms': 2, 'Pathologic Processes': 1})
['Clubfoot', 'Equinus Deformity']
Counter({'Foot Deformities': 2, 'Congenital Abnormalities': 1, 'Musculoskeletal Abnormalities': 1})
['Postoperative Hemorrhage', 'Blood Loss, Surgical']
Counter({'Pathologic Processes': 4})
['Sarcoidosis, Pulmonary', 'Sarcoidosis']
Counter({'Lymphatic Diseases': 2, 'Lung Diseases': 1})
['Angioedemas, Hereditary', 'Angioedema', 'Hereditary Angioedema Types I and II']
Counter({'Vascular Diseases': 3, 'Hypersensitivity': 3, 'Skin Diseases': 3, 'Genetic Diseases, Inborn': 1})
['Hyperphagia', 'Prader-Willi Syndrome']
Counter({'Congenital Abnormalities': 2, 'Neurologic Manifestations': 1, 'Nutrition Disorders': 1, 'Signs and Symptoms': 1, 'Genetic Diseases, Inborn': 1})
['Adenoma, Pleomorphic', 'Mixed Tumor, Mesodermal', 'Syringoma']
Counter({'Neoplasms by Histologic Type': 6})
['Tic Disorders', 'Tics', 'Tourette Syndrome']
Counter({'Central Nervous System Diseases': 3, 'Mental Disorders Diagnosed in Childhood': 2, 'Neurologic Manifestations': 1, 'Genetic Diseases, Inborn': 1, 'Signs and Symptoms': 1, 'Neurodegenerative Diseases': 1})
['Lymphoma, Primary Cutaneous Anaplastic Large Cell', 'Lymphomatoid Papulosis']
Counter({'Neoplasms by Histologic Type': 2, 'Immunoproliferative Disorders': 2, 'Lymphatic Diseases': 2})
['Asymptomatic Infections', 'Bacteriuria', 'Pyelonephritis', 'Urinary Tract Infections', 'Vesico-Ureteral Reflux']
Counter({'Urologic Diseases': 5, 'Female Urogenital Diseases': 5, 'Infection': 2, 'Pathologic Processes': 1})
['Lesch-Nyhan Syndrome', 'Self-Injurious Behavior']
Counter({'Genetic Diseases, Inborn': 5, 'Metabolic Diseases': 3, 'Neurologic Manifestations': 1, 'Central Nervous System Diseases': 1, 'Neurodegenerative Diseases': 1, 'Behavior': 1})
['Open Bite', 'Sialorrhea']
Counter({'Tooth Diseases': 1, 'Mouth Diseases': 1})
['Affective Disorders, Psychotic', 'Schizophrenia and Disorders with Psychotic Features']
Counter({'Mood Disorders': 1, 'Schizophrenia and Disorders with Psychotic Features': 1})
['Long QT Syndrome', 'Brugada Syndrome', 'Romano-Ward Syndrome', 'Arrhythmogenic Right Ventricular Dysplasia']
Counter({'Heart Diseases': 5, 'Congenital Abnormalities': 3, 'Pathologic Processes': 2, 'Cardiovascular Abnormalities': 1, 'Genetic Diseases, Inborn': 1})
['Vaginal Fistula', 'Rectovaginal Fistula', 'Vesicovaginal Fistula']
Counter({'Pathological Conditions, Anatomical': 5, 'Female Urogenital Diseases': 3, 'Gastrointestinal Diseases': 2, 'Digestive System Fistula': 1})
['Herpes Labialis', 'Herpes Simplex', 'Herpes Genitalis']
Counter({'DNA Virus Infections': 3, 'Skin Diseases': 2, 'Skin Diseases, Viral': 2, 'Sexually Transmitted Diseases': 1, 'Mouth Diseases': 1, 'Genital Diseases, Male': 1, 'Female Urogenital Diseases': 1})
['Polyradiculoneuropathy', 'Polyradiculoneuropathy, Chronic Inflammatory Demyelinating']
Counter({'Autoimmune Diseases': 2, 'Autoimmune Diseases of the Nervous System': 2, 'Neuromuscular Diseases': 2, 'Demyelinating Diseases': 2})
['Stress Disorders, Traumatic', 'Stress Disorders, Post-Traumatic']
Counter({'Anxiety Disorders': 2})
['Hyperkinesis', 'Attention Deficit Disorder with Hyperactivity']
Counter({'Neurologic Manifestations': 1, 'Signs and Symptoms': 1, 'Mental Disorders Diagnosed in Childhood': 1})
['Scleroderma, Limited', 'CREST Syndrome']
Counter({'Connective Tissue Diseases': 2, 'Skin Diseases': 2, 'Vascular Diseases': 2, 'Gastrointestinal Diseases': 1, 'Metabolic Diseases': 1})
['Lupus Erythematosus, Systemic', 'Glomerulonephritis, IGA', 'Nephrosis, Lipoid', 'Glomerulonephritis, Membranous', 'Vasculitis, Central Nervous System', 'Glomerulonephritis, Membranoproliferative', 'Glomerulonephritis', 'Nephritis', 'Kwashiorkor', 'Lupus Erythematosus, Cutaneous', 'Lupus Vasculitis, Central Nervous System', 'Lupus Erythematosus, Discoid', 'Protein-Energy Malnutrition', 'Nephrotic Syndrome', 'Glomerulosclerosis, Focal Segmental', 'Hypoalbuminemia', 'Nephrosis', 'Lupus Nephritis']
Counter({'Urologic Diseases': 10, 'Female Urogenital Diseases': 10, 'Autoimmune Diseases': 7, 'Central Nervous System Diseases': 7, 'Connective Tissue Diseases': 5, 'Vascular Diseases': 4, 'Autoimmune Diseases of the Nervous System': 2, 'Nutrition Disorders': 2, 'Skin Diseases': 2, 'Hematologic Diseases': 1, 'Glomerulonephritis, Membranoproliferative': 1})
['Sprue, Tropical', 'HIV Enteropathy', 'Ileal Diseases']
Counter({'Gastrointestinal Diseases': 3, 'Immunologic Deficiency Syndromes': 1, 'Metabolic Diseases': 1, 'RNA Virus Infections': 1, 'Sexually Transmitted Diseases': 1})
['Lung Diseases, Obstructive', 'Respiration Disorders', 'Pulmonary Disease, Chronic Obstructive', 'Chronic Disease', 'Lung Diseases']
Counter({'Lung Diseases': 3, 'Pathologic Processes': 1, 'Respiration Disorders': 1})
['Heart Septal Defects, Ventricular', 'Heart Septal Defects, Atrial', 'Ventricular Dysfunction, Right', 'Pulmonary Valve Stenosis', 'Heart Septal Defects', 'Menkes Kinky Hair Syndrome', 'Pulmonary Atresia', 'Loeys-Dietz Syndrome', 'Ehlers-Danlos Syndrome', 'Vertebral Artery Dissection', 'Situs Inversus', 'Foramen Ovale, Patent', 'Ventricular Dysfunction, Left', 'Pulmonary Heart Disease', 'Arachnodactyly', 'Craniosynostoses', 'Skin Abnormalities', 'Pulmonary Valve Insufficiency', 'Endocardial Cushion Defects', 'Transposition of Great Vessels', 'Aortic Coarctation', 'Embolism, Paradoxical', 'Aneurysm, Dissecting', 'Plagiocephaly', 'Marfan Syndrome', 'Tetralogy of Fallot', 'Ventricular Dysfunction', 'Nail-Patella Syndrome']
Counter({'Congenital Abnormalities': 21, 'Heart Diseases': 17, 'Vascular Diseases': 10, 'Cardiovascular Abnormalities': 10, 'Genetic Diseases, Inborn': 9, 'Musculoskeletal Abnormalities': 6, 'Skin Diseases': 5, 'Metabolic Diseases': 3, 'Central Nervous System Diseases': 3, 'Connective Tissue Diseases': 2, 'Bone Diseases': 2, 'Hematologic Diseases': 1, 'Neurologic Manifestations': 1, 'Joint Diseases': 1, 'Neurodegenerative Diseases': 1, 'Trauma, Nervous System': 1})
['Leg Injuries', 'Amputation, Traumatic', 'Fractures, Spontaneous', 'Fractures, Malunited', 'Joint Loose Bodies']
Counter({'Fractures, Bone': 2, 'Amputation, Traumatic': 1, 'Leg Injuries': 1, 'Joint Diseases': 1})
['Angiofibroma', 'Angiomyolipoma', 'Lymphangioleiomyomatosis', 'Angiolipoma', 'Lymphangiomyoma', 'Tuberous Sclerosis']
Counter({'Neoplasms by Histologic Type': 7, 'Genetic Diseases, Inborn': 2, 'Lymphatic Diseases': 2, 'Immunoproliferative Disorders': 2, 'Congenital Abnormalities': 1, 'Nervous System Malformations': 1, 'Neoplasms, Multiple Primary': 1, 'Neurocutaneous Syndromes': 1, 'Neurodegenerative Diseases': 1, 'Neoplastic Syndromes, Hereditary': 1, 'Hamartoma': 1})
['Ectodermal Dysplasia 1, Anhidrotic', 'Ectodermal Dysplasia']
Counter({'Skin Diseases': 4, 'Congenital Abnormalities': 4, 'Genetic Diseases, Inborn': 3})
['Colonic Diseases', 'Rectal Diseases', 'Colonic Diseases, Functional']
Counter({'Gastrointestinal Diseases': 3})
['Pleural Effusion, Malignant', 'Tuberculosis, Pleural', 'Pleurisy', 'Empyema, Pleural', 'Empyema', 'Pleural Effusion', 'Pleural Diseases']
Counter({'Pleural Diseases': 7, 'Respiratory Tract Infections': 3, 'Infection': 3, 'Respiratory Tract Neoplasms': 1, 'Pathologic Processes': 1, 'Bacterial Infections': 1, 'Neoplasms by Site': 1})
['Renal Artery Obstruction', 'Hypertension, Renovascular']
Counter({'Female Urogenital Diseases': 2, 'Urologic Diseases': 2, 'Vascular Diseases': 2})
['Liver Failure', 'Fatty Liver', 'Liver Failure, Acute', 'Liver Diseases', 'End Stage Liver Disease']
Counter({'Liver Diseases': 5})
['Constipation', 'Irritable Bowel Syndrome', 'Diarrhea', 'Dysentery']
Counter({'Gastrointestinal Diseases': 3, 'Signs and Symptoms': 2})
['Lentigo', 'Neoplastic Syndromes, Hereditary', 'Heart Neoplasms', 'Von Hippel-Lindau Disease', 'Bone Diseases, Developmental', 'Carney Complex', 'Peutz-Jeghers Syndrome', "Hutchinson's Melanotic Freckle", 'Hemangioblastoma', 'Myxoma', 'Neoplastic Processes', 'Leiomyomatosis']
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-73-c298648afd1c> in <module>()
      1 for g in groups:
      2     print g
----> 3     print mesh_summary(g)

<ipython-input-68-0ca1a0426479> in mesh_summary(cond_list)
      6     mesh_list = Counter()
      7     for c in cond_list:
----> 8         for m in mesh_ids[c]:
      9             if len(m) >= 7 and m[:7] in mesh_cats:
     10                 mesh_list[mesh_cats[m[:7]]] += 1

KeyError: 'Von Hippel-Lindau Disease'

Extract high-level codes and generate distance matrix


In [ ]:
for