Giter Club home page Giter Club logo

comorbid-graphs's Introduction

Comorbid-Graphs

Side by side comparison of disorders based on comorbidity factors for clinical psychology.

  1. create hierarchies of sources of information
  2. extract valuable elements from text
  3. visualize dependencies

Simple Example

Create from sample file:

from comorbid_graphs import ComorbidGraph
my_graph = ComorbidGraph.from_yaml('big_picture.yaml')

print(my_graph.explore(maxlevel=4))

Results:

Diagnosing Mental Health Issues
├── Frameworks
│   ├── DSM-V
│   │   ├── what
│   │   ├── where
│   │   │   ├── wikipedia
│   │   │   ├── website
│   │   │   └── manual
│   │   ├── who
│   │   │   └── APA
│   │   ├── elements
│   │   │   ├── disorder
│   │   │   ├── symptom
│   │   │   └── diagnostic guideline
│   │   └── mini versions
│   │       ├── Chinese Classification of Mental Disorders
│   │       │   └── wikipedia
│   │       └── Psychodynamic Diagnostic Manual
│   │           └── wikipedia
│   ├── ICD-10
│   │   ├── what
│   │   ├── where
│   │   │   ├── website
│   │   │   ├── manual
│   │   │   └── wikipedia
│   │   ├── who
│   │   │   └── WHO
│   │   └── elements
│   │       └── disorder
│   ├── HiTOP
│   │   ├── what
│   │   ├── where
│   │   │   ├── website
│   │   │   └── manual
│   │   └── elements
│   │       ├── spectra
│   │       ├── subfactor
│   │       ├── syndrome
│   │       ├── maladaptive trait
│   │       ├── symptoms
│   │       └── disorder
│   └── RDoC
│       ├── what
│       ├── where
│       │   ├── website
│       │   └── wikipedia
│       ├── who
│       │   └── nimh
│       └── elements
│           ├── genes
│           ├── molecules
│           ├── cells
│           ├── circuits
│           ├── physiology
│           ├── behaviors
│           ├── self-reports
│           └── paradigms
└── approaches
    ├── authoritative
    ├── psychodynamic
    ├── empirical
    └── network

Additional Resources


References

This package can be thought as a thin wrapper to Anytree, with some useful functionalities for use-case of ontologies and text-processing.

comorbid-graphs's People

Contributors

pomodoren avatar

Watchers

 avatar  avatar

comorbid-graphs's Issues

Wiki: Extract categories

Recursive extraction of wikipedia categories together with lists.
Store the info as:

name: page_name
url: wikipedia.org/page_name

Merge: Multiple subgraphs should be mergeable.

cg_res1 = cg.simple_search('pain', ComorbidGraphNode)
cg_res2 = cg.advanced_search(
     'ache inc_ancestor:nervous system symptom exc_ancestor:pain',
     node_type=ComorbidGraphNode
)
subgraph_list = [cg_res1, cg_res2]
resulting_merged_subgraph = cg.merge(subgraph_list=subgraph_list)
resulting_merged_subgraph.explore()

DeepCopy: Copying Annotation List

Because of the problem of pointers of objects, we are using deep copy for now.
Still the problem increases in scale if we want to use the results of the search in an analysis sense.
In this case the problem will become more problematic once increase in scale.

Wiki: Extract pages

Advanced extraction together with extraction of sections for pages that are not Category or List or some other special word.

Searching: Define, code, test

  • Define
anxiety, panic attack

inc_parent:DSM-V
inc_title:Disorder
inc_text_longer:300

exc_ancestor:Neurodevelopmental Disorders
  • Code
  • Test

Multiparent: Hashtag parent

Introduction of multiparents should allow the graph properties.
Closed dependencies should allow for checks in this tree or not when loading from tree.

# closed-dependencies: checks whether all parents are in the hierarchy
# if not throws error
ComorbidGraph.load_yaml('graph.yaml', closed_dependencies=True)

To be able to do this kind of change, I should allow multiparent actions for each main functionality.

  • load
    • from_tree
    • from_ontology
  • export
  • search
    • select
    • simple search
    • advanced search

Multiparent: Closed dependencies for merged

Closed dependencies when merging many graphs.

# closed_dependencies: check for at parent match in the hierarchy
# if not, release 
ComorbidGraph.merge_trees(
  list_of_graphs,
  closed_dependencies=True
)

Compare: Add side to side comparison

Assume that you have two graphs with shared children-names.
How do you compare these?

  • check where they share names of children - if not compare on bodies
  • if they share names, combine names, create a matrix of comparison

Multiparent: Parent Sorting

Allow different lambda's for updating order of parents for each node.

# sample.yaml
name: parent
children:
- name: node-1
  parents:
  - name: parent-1
  - name: parent-2
- name: node-2
  parents: 
  - name: parent-2 
  - name: parent-3 
name: parent-1 
name: parent-2
name: parent-3

Allow sorting by score.

ComorbidGraph
.load_yaml('sample.yaml')
.sort_parents(by_score=['score'])
.to_yaml('sample_ordered.yaml')
# sample.yaml
name: parent
children:
- name: node-1
  score: 1
  parents:
  - name: parent-1
    score: 0.5
  - name: parent-2
    score: 0.2
- name: node-2
  score: 0.8
  parents: 
  - name: parent-2 
    score: 0.3
  - name: parent-3 
    score: 0.1
name: parent-1 
name: parent-2
name: parent-3
ComorbidGraph
.load_yaml('sample.yaml')
.sort_parents(by_name=['parent-1', 'parent-3'])
.to_yaml('sample_ordered.yaml')
# sample_ordered.yaml
name: parent
name: parent-1 
children: 
- name: node-1
  parents:
  - name: parent
  - name: parent-2
name: parent-2
name: parent-3
children: 
  name: node-2
  parents:
  - name: parent
  - name: parent-2 

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.