Coder Social home page Coder Social logo

oboder's Introduction

Oboder

An extremely small python library implementing an OBO file reaDER.

Installation

pip install -U "oboder @ git+https://github.com/aedera/oboder.git"

Usage

import oboder

# read a given obo file, rels=True includes other relationships in addition to 'is_a'
go = oboder.read('data/go.obo', with_rels=True)

# get a set containing ancestors of a given GO term for all relationships
anc = go.get_ancestor_set('GO:0017011')

# or ancestors for a specific relation
anc = go.get_ancestor_set('GO:0017011', rels=['part_of'])

# get a list where elements are branches of ancestors
branches = go.get_ancestors('GO:0017011')

# loop over the terms in the obo file
for t in go.ont.keys():
  print(go.ont[t])

In addition, oboder can be used to explore an OBO file, for example, by exploring specific GO terms.

go.ont['GO:0019538']

this returns a dict with the following information of the term with id 'GO:0019538'

{
'is_a': ['GO:0043170', 'GO:0044238'],
'part_of': [],
'has_part': [],
'regulates': [],
'negatively_regulates': [],
'positively_regulates': [],
'occurs_in': [],
'ends_during': [],
'happens_during': [],
'alt_ids': {'GO:0006411'},
'is_obsolete': False,
'id': 'GO:0019538',
'name': 'protein metabolic process',
'namespace': 'biological_process',
'children': {'GO:0045558', 'GO:1901142', ..., 'GO:0072376'}
}

Note that this term has alternative ids, indicated by the key alt_ids. The reference term of an alternative id can be retrieved with this command

go.get_refterm('GO:0006411')

Alternative terms can be included when reading an obo file by using the argument include_alt_ids

go = oboder.read('data/go.obo', include_alt_ids=True)

oboder's People

Contributors

aedera avatar

Stargazers

 avatar

Watchers

 avatar

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.