PyOpenWorm.network module

class PyOpenWorm.network.Network(worm=None, **kwargs)[source]

Bases: PyOpenWorm.biology.BiologyType

A network of neurons

aneuron(name)[source]

Get a neuron by name.

Example:

# Grabs the representation of the neuronal network
>>> net = Worm().get_neuron_network()

# Grab a specific neuron
>>> aval = net.aneuron('AVAL')

>>> aval.type()
set([u'interneuron'])
Parameters:name – Name of a c. elegans neuron
Returns:Neuron corresponding to the name given
Return type:PyOpenWorm.neuron.Neuron
defined_augment()[source]

This fuction must return False if identifier_augment() would raise an IdentifierMissingException. Override it when defining a non-standard identifier for subclasses of DataObjects.

identifier_augment()[source]

Override this method to define an identifier in lieu of one explicity set.

One must also override defined_augment() to return True whenever this method could return a valid identifier. IdentifierMissingException should be raised if an identifier cannot be generated by this method.

Raises:
IdentifierMissingException
interneurons()[source]

Get all interneurons

Returns:A iterable of all interneurons
Return type:iter(Neuron)
motor()[source]

Get all motor

Returns:A iterable of all motor neurons
Return type:iter(Neuron)
neuron_names()[source]

Gets the complete set of neurons’ names in this network.

Example:

# Grabs the representation of the neuronal network
>>> net = Worm().get_neuron_network()

#NOTE: This is a VERY slow operation right now
>>> len(set(net.neuron_names()))
302
>>> set(net.neuron_names())
set(['VB4', 'PDEL', 'HSNL', 'SIBDR', ... 'RIAL', 'MCR', 'LUAL'])
sensory()[source]

Get all sensory neurons

Returns:A iterable of all sensory neurons
Return type:iter(Neuron)
neuron

Returns a set of all Neuron objects in the network

synapse

Returns a set of all synapses in the network