Giter VIP home page Giter VIP logo

cbn-bel's Introduction

BEL Export of Causal Biological Networks Database

This repository contains exports of the Causal Biologial Networks Database (CBN) as Biological Expression Language (BEL). The research article describing the CBN is:

Causal biological network database: A comprehensive platform of causal biological network models focused on the pulmonary and vascular systems. Talikka, M., Boue, S., & Schlage, W. K. Computational Systems Toxicology (2015) 65–93. DOI: 10.1007/978-1-4939-2778-4_3

BEL is a domain specific language that enables the expression of biological relationships in a machine-readable format. It is supported by the PyBEL software ecosystem.

Download CBN as BEL

The network is available in two BEL formats in the /bel directory:

  • BEL Script - see description below
  • Nodelink JSON - see description below

In the human_2.0, you can also find the networks in both the raw and grounded formats. These are ultimately combine to make the full exports in the bel/ directory. All edges maintain tags as to their provenance from which network they came.

License

This repository and its maintainers are not affiliated with the content creators at sbv IMPROVER project nor Philip Morris International, but they have graciously allowed us to redistribute their content with the following message:

The sbv IMPROVER project, the website and the Symposia are part of a collaborative project designed to enable scientists to learn about and contribute to the development of a new crowd sourcing method for verification of scientific data and results. The current challenges, website and biological network models were developed and are maintained as part of a collaboration among Selventa, OrangeBus and ADS. The project is led and funded by Philip Morris International. For more information on the focus of Philip Morris International’s research, please visit www.pmi.com.

Please cite:

as well as any relevant publications.

Format Descriptions

BEL Script

BEL Script is the de facto standard for BEL, which all BEL-aware applications should be able to consume. It contains informations about the nodes, edges, and their biological context in a domain-specific language. It can be parsed with PyBEL or other BEL parsers.

Example opening BEL Script using pybel.from_bel_script_gz():

from pybel import from_bel_script_gz
graph = from_bel_script_gz('human_2.0.bel.gz')

Nodelink JSON

Node-link is the format popularized by Javascript frameworks like D3 for representing network information. Since the main data structire in PyBEL is a network, it often makes sense to use Nodelink JSON as a pre-compiled data structure for BEL (since parsing/compiling BEL takes a lot longer than JSON). The schema is specific to PyBEL, but this is the fastest to load.

Example opening Nodelink JSON using pybel.from_nodelink_gz():

from pybel import from_nodelink_gz
graph = from_nodelink_gz('human_2.0.bel.nodelink.json.gz')

cbn-bel's People

Contributors

cthoyt avatar

Watchers

 avatar  avatar  avatar

cbn-bel's Issues

Cannot parse graph of full file

Using pybel to parse human_2.0.bel.nodelink.json in this repository errors with NotImplementedError: where is key cbn_pathway?. Looking into the file itself, it seems like the key cbn_pathway does exist, I'm wondering if the generated data files might be out of date with respect to pybel?

The following code reproduces the error:

import pybel
import requests
full_res = requests.get('https://raw.githubusercontent.com/pybel/cbn-bel/master/bel/human_2.0.bel.nodelink.json')
full_graph = pybel.from_nodelink(full_res.json())

Python version 3.11.4
OS: Ubuntu 20.04.6
pybel version: 0.15.5

The traceback I get:

---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
Cell In[13], line 1
----> 1 full_graph = pybel.from_nodelink(full_res.json())

File ~/.virtualenvs/py3114/lib/python3.11/site-packages/pybel/io/nodelink.py:100, in from_nodelink(graph_json_dict, check_version)
     98 if pybel_version[1] < 14:  # if minor version is less than 14
     99     raise ValueError("Invalid NodeLink JSON from old version of PyBEL (v{}.{}.{})".format(*pybel_version))
--> 100 graph = _from_nodelink_json_helper(graph_json_dict)
    101 return ensure_version(graph, check_version=check_version)

File ~/.virtualenvs/py3114/lib/python3.11/site-packages/pybel/io/nodelink.py:204, in _from_nodelink_json_helper(data)
    201         edge_data[CITATION] = citation_dict(**edge_data[CITATION])
    203     if ANNOTATIONS in edge_data:
--> 204         edge_data[ANNOTATIONS] = graph._clean_annotations(edge_data[ANNOTATIONS])
    206     graph.add_edge(u, v, key=hash_edge(u, v, edge_data), **edge_data)
    208 return graph

File ~/.virtualenvs/py3114/lib/python3.11/site-packages/pybel/struct/graph.py:1011, in BELGraph._clean_annotations(self, annotations_dict)
    994 def _clean_annotations(self, annotations_dict: AnnotationsHint) -> AnnotationsDict:
    995     """Fix the formatting of annotation dict.
    996 
    997     .. seealso:: https://github.com/vtoure/bep/blob/master/docs/published/BEP-0013.md
   (...)
   1009        ``{'ECO': dict(namespace='ECO', identifier='0007682', name='reporter gene assay...')}``
   1010     """
-> 1011     return {
   1012         key: sorted(
   1013             self._clean_value(key, values),
   1014             key=lambda e: (e.namespace, e.identifier, e.name),
   1015         )
   1016         for key, values in annotations_dict.items()
   1017     }

File ~/.virtualenvs/py3114/lib/python3.11/site-packages/pybel/struct/graph.py:1013, in <dictcomp>(.0)
    994 def _clean_annotations(self, annotations_dict: AnnotationsHint) -> AnnotationsDict:
    995     """Fix the formatting of annotation dict.
    996 
    997     .. seealso:: https://github.com/vtoure/bep/blob/master/docs/published/BEP-0013.md
   (...)
   1009        ``{'ECO': dict(namespace='ECO', identifier='0007682', name='reporter gene assay...')}``
   1010     """
   1011     return {
   1012         key: sorted(
-> 1013             self._clean_value(key, values),
   1014             key=lambda e: (e.namespace, e.identifier, e.name),
   1015         )
   1016         for key, values in annotations_dict.items()
   1017     }

File ~/.virtualenvs/py3114/lib/python3.11/site-packages/pybel/struct/graph.py:1052, in BELGraph._clean_value(self, key, values)
   1049     return self._clean_value_helper(key=key, namespace=key, values=values)
   1051 if self.raise_on_missing_annotations:
-> 1052     raise NotImplementedError(f"where is key {key}?")
   1054 return self._clean_value_helper(key=key, namespace=key, values=values)

NotImplementedError: where is key cbn_pathway?

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.