A Python library for working with OpenWorm data and models
Project description
[![Build Status](https://travis-ci.org/openworm/PyOpenWorm.png?branch=master)](https://travis-ci.org/openworm/PyOpenWorm)
PyOpenWorm
===========
Unified data access library for data about the c. elegans anatomy and model for the OpenWorm project
What does it do?
----------------
Allows asking various questions about the c. elegans nervous system.
Basic Usage
-----------
```python
>>>import PyOpenWorm
# Grabs the representation of the neuronal network
>>>net = PyOpenWorm.Worm().get_neuron_network()
>>>net.aneuron('AVAL').type()
Interneuron
#show how many gap junctions go in and out of AVAL
>>>net.aneuron('AVAL').GJ_degree()
60
```
More examples
-------------
Returns information about individual neurons::
```python
>>>net.aneuron('AVAL').name()
AVAL
#list all known receptors
>>>net.aneuron('AVAL').receptors()
['GLR-1', 'NMR-1', 'GLR-4', 'GLR-2', 'GGR-3', 'UNC-8', 'GLR-5', 'NMR-2']
>>>net.aneuron('DD5').type()
motor
>>>net.aneuron('PHAL').type()
sensory
#show how many chemical synapses go in and out of AVAL
>>>net.aneuron('AVAL').Syn_degree()
74
```
Returns the list of all neurons::
```python
>>>len(net.neurons())
302
```
Returns the list of all muscles::
```python
>>>'MDL08' in PyOpenWorm.Worm().muscles()
True
```
Returns provenance information providing evidence about facts::
```python
>>>ader = PyOpenWorm.Neuron('ADER')
>>>ader.receptors()
['ACR-16', 'TYRA-3', 'DOP-2', 'EXP-1']
#look up what reference says this neuron has a receptor EXP-1
>>>ader.get_reference(0,'EXP-1')
['http://dx.doi.org/10.100.123/natneuro']
```
Returns the c. elegans connectome represented as a [NetworkX](http://networkx.github.io/documentation/latest/) graph::
```python
>>>net.as_networkx()
<networkx.classes.digraph.DiGraph object at 0x10f28bc10>
```
Why is this necessary?
----------------------
There are many different useful ways to compute with data related to the worm.
Different data structures have different strengths and answer different questions.
For example, a NetworkX representation of the connectome as a complex graph enables
questions to be asked about first and second nearest neighbors of a given neuron.
In contrast, an RDF semantic graph representation is useful for reading and
writing annotations about multiple aspects of a neuron, such as what papers
have been written about it, multiple different properties it may have such as
ion channels and neurotransmitter receptors. A NeuroML representation is useful
for answering questions about model morphology and simulation parameters. Lastly,
a Blender representation is a full 3D shape definition that can be used for
calculations in 3D space. Further representations regarding activity patterns
such as Neo or simulated activity can be considered as well.
Using these different representations separately leads to ad hoc scripting for
for each representation. This presents a challenge for data integration and
consolidation of information in 'master' authoritative representations. By
creating a unified data access layer, different representations
can become encapsulated into an abstract view. This allows the user to work with
objects related to the biological reality of the worm. This has the advantage that
the user can forget about which representation is being used under the hood.
The worm itself has a unified sense of neurons, networks, muscles,
ion channels, etc and so should our code.
Installation
------------
git clone https://github.com/openworm/PyOpenWorm.git
cd PyOpenWorm
python setup.py install
Running tests
-------------
After checking out the project, tests can be run on the command line with::
python -m unittest discover -s tests
PyOpenWorm
===========
Unified data access library for data about the c. elegans anatomy and model for the OpenWorm project
What does it do?
----------------
Allows asking various questions about the c. elegans nervous system.
Basic Usage
-----------
```python
>>>import PyOpenWorm
# Grabs the representation of the neuronal network
>>>net = PyOpenWorm.Worm().get_neuron_network()
>>>net.aneuron('AVAL').type()
Interneuron
#show how many gap junctions go in and out of AVAL
>>>net.aneuron('AVAL').GJ_degree()
60
```
More examples
-------------
Returns information about individual neurons::
```python
>>>net.aneuron('AVAL').name()
AVAL
#list all known receptors
>>>net.aneuron('AVAL').receptors()
['GLR-1', 'NMR-1', 'GLR-4', 'GLR-2', 'GGR-3', 'UNC-8', 'GLR-5', 'NMR-2']
>>>net.aneuron('DD5').type()
motor
>>>net.aneuron('PHAL').type()
sensory
#show how many chemical synapses go in and out of AVAL
>>>net.aneuron('AVAL').Syn_degree()
74
```
Returns the list of all neurons::
```python
>>>len(net.neurons())
302
```
Returns the list of all muscles::
```python
>>>'MDL08' in PyOpenWorm.Worm().muscles()
True
```
Returns provenance information providing evidence about facts::
```python
>>>ader = PyOpenWorm.Neuron('ADER')
>>>ader.receptors()
['ACR-16', 'TYRA-3', 'DOP-2', 'EXP-1']
#look up what reference says this neuron has a receptor EXP-1
>>>ader.get_reference(0,'EXP-1')
['http://dx.doi.org/10.100.123/natneuro']
```
Returns the c. elegans connectome represented as a [NetworkX](http://networkx.github.io/documentation/latest/) graph::
```python
>>>net.as_networkx()
<networkx.classes.digraph.DiGraph object at 0x10f28bc10>
```
Why is this necessary?
----------------------
There are many different useful ways to compute with data related to the worm.
Different data structures have different strengths and answer different questions.
For example, a NetworkX representation of the connectome as a complex graph enables
questions to be asked about first and second nearest neighbors of a given neuron.
In contrast, an RDF semantic graph representation is useful for reading and
writing annotations about multiple aspects of a neuron, such as what papers
have been written about it, multiple different properties it may have such as
ion channels and neurotransmitter receptors. A NeuroML representation is useful
for answering questions about model morphology and simulation parameters. Lastly,
a Blender representation is a full 3D shape definition that can be used for
calculations in 3D space. Further representations regarding activity patterns
such as Neo or simulated activity can be considered as well.
Using these different representations separately leads to ad hoc scripting for
for each representation. This presents a challenge for data integration and
consolidation of information in 'master' authoritative representations. By
creating a unified data access layer, different representations
can become encapsulated into an abstract view. This allows the user to work with
objects related to the biological reality of the worm. This has the advantage that
the user can forget about which representation is being used under the hood.
The worm itself has a unified sense of neurons, networks, muscles,
ion channels, etc and so should our code.
Installation
------------
git clone https://github.com/openworm/PyOpenWorm.git
cd PyOpenWorm
python setup.py install
Running tests
-------------
After checking out the project, tests can be run on the command line with::
python -m unittest discover -s tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file PyOpenWorm-0.0.1-alpha.tar.gz
.
File metadata
- Download URL: PyOpenWorm-0.0.1-alpha.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efd2cb66c6be72c3136cf451b6eca317c5986249a830b5a47fdec952fc7a738a |
|
MD5 | a39c05b2ae8e17a95e065cae45f367d7 |
|
BLAKE2b-256 | 36667a5ad28defc0c84803655ce09fe61c3a19e52a3a1772e2c815c31ff20c85 |