All Projects → dhimmel → Obonet

dhimmel / Obonet

Licence: other
OBO-formatted ontologies → networkx (Python 3)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Obonet

Netcopa
Network Configuration Parser
Stars: ✭ 112 (+75%)
Mutual labels:  parser, network
Csstree
A tool set for CSS including fast detailed parser, walker, generator and lexer based on W3C specs and browser implementations
Stars: ✭ 1,121 (+1651.56%)
Mutual labels:  parser
Vibe Core
Repository for the next generation of vibe.d's core package.
Stars: ✭ 56 (-12.5%)
Mutual labels:  network
When
A natural language date/time parser with pluggable rules
Stars: ✭ 1,113 (+1639.06%)
Mutual labels:  parser
Avenue
Wrapper around URLSession and URLSessionTask to enable seamless integration with Operation / OperationQueue.
Stars: ✭ 58 (-9.37%)
Mutual labels:  network
Spruce Network
Decentralized peer-to-peer mesh network.
Stars: ✭ 61 (-4.69%)
Mutual labels:  network
Gmime
A C/C++ MIME creation and parser library with support for S/MIME, PGP, and Unix mbox spools.
Stars: ✭ 57 (-10.94%)
Mutual labels:  parser
Formula Parser
Parsing and evaluating mathematical formulas given as strings.
Stars: ✭ 62 (-3.12%)
Mutual labels:  parser
Mthawkeye
Profiling / Debugging assist tools for iOS. (Memory Leak, OOM, ANR, Hard Stalling, Network, OpenGL, Time Profile ...)
Stars: ✭ 1,119 (+1648.44%)
Mutual labels:  network
Collie
An asynchronous event-driven network framework( port netty ) written in D.
Stars: ✭ 60 (-6.25%)
Mutual labels:  network
String Calc
PHP calculator library for mathematical terms (expressions) passed as strings
Stars: ✭ 60 (-6.25%)
Mutual labels:  parser
Dnscrypt Menu
Manage DNSCrypt from the macOS menu bar (BitBar plugin)
Stars: ✭ 59 (-7.81%)
Mutual labels:  network
Mlua
An interpreter of lua-like language written in C++
Stars: ✭ 61 (-4.69%)
Mutual labels:  parser
Distributedsystem Series
📚 深入浅出分布式基础架构,Linux 与操作系统篇 | 分布式系统篇 | 分布式计算篇 | 数据库篇 | 网络篇 | 虚拟化与编排篇 | 大数据与云计算篇
Stars: ✭ 1,092 (+1606.25%)
Mutual labels:  network
Bibliothecary
📔 Libraries.io Package Manager Manifest Parsers
Stars: ✭ 62 (-3.12%)
Mutual labels:  parser
Macfinder
An iOS Library that helps you find the MAC Address of a specific IP
Stars: ✭ 57 (-10.94%)
Mutual labels:  network
Pcapxray
❄️ PcapXray - A Network Forensics Tool - To visualize a Packet Capture offline as a Network Diagram including device identification, highlight important communication and file extraction
Stars: ✭ 1,096 (+1612.5%)
Mutual labels:  network
Url Highlight
PHP library to parse urls from string input
Stars: ✭ 61 (-4.69%)
Mutual labels:  parser
Dexbox
A lightweight dex file parsing library
Stars: ✭ 64 (+0%)
Mutual labels:  parser
Quill Delta Parser
A PHP library to parse and render Quill WYSIWYG Deltas into HTML - Flexibel and extendible for custom elements.
Stars: ✭ 63 (-1.56%)
Mutual labels:  parser

obonet: load OBO-formatted ontologies into networkx

Build Status

Read OBO-formatted ontologies in Python. obonet is

  • user friendly
  • no nonsense
  • pythonic
  • modern
  • simple and tested
  • lightweight
  • networkx leveraging

This Python 3.4+ package loads OBO serialized ontologies into networks. The function obonet.read_obo() takes an .obo file and returns a networkx.MultiDiGraph representation of the ontology. The parser was designed for the OBO specification version 1.2 & 1.4.

Usage

This package is designed and tested on python ≥ 3.4. OBO files can be read from a path, URL, or open file handle. Compression is inferred from the path's extension. See example usage below:

import networkx
import obonet

# Read the taxrank ontology
url = 'https://github.com/dhimmel/obonet/raw/master/tests/data/taxrank.obo'
graph = obonet.read_obo(url)

# Or read the xz-compressed taxrank ontology
url = 'https://github.com/dhimmel/obonet/raw/master/tests/data/taxrank.obo.xz'
graph = obonet.read_obo(url)

# Number of nodes
len(graph)

# Number of edges
graph.number_of_edges()

# Check if the ontology is a DAG
networkx.is_directed_acyclic_graph(graph)

# Mapping from term ID to name
id_to_name = {id_: data.get('name') for id_, data in graph.nodes(data=True)}
id_to_name['TAXRANK:0000006']  # TAXRANK:0000006 is species

# Find all superterms of species. Note that networkx.descendants gets
# superterms, while networkx.ancestors returns subterms.
networkx.descendants(graph, 'TAXRANK:0000006')

For a more detailed tutorial, see the Gene Ontology example notebook.

Installation

PyPI

The recommended approach is to install the latest release from PyPI using:

pip install obonet

However, if you'd like to install the most recent version from GitHub, use:

pip install git+https://github.com/dhimmel/obonet.git#egg=obonet

Contributing

GitHub issues

We welcome feature suggestions and community contributions. Currently, only reading OBO files is supported. Please open an issue if you're interested in writing OBO files in Python.

Release instructions

This section is only relevant for project maintainers. Travis CI deployments are used to upload releases to PyPI. To create a new release, do the following:

  1. Bump the __version__ in obonet/__init__.py.

  2. Run the following commands:

TAG=v`python setup.py --version`
git add obonet/__init__.py
git commit --message="Upgrade version to $TAG"
git push
git tag --annotate $TAG --message="Release $TAG"
git push --tags
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].