Last active
August 29, 2015 14:14
-
-
Save mwatts15/d746b054cf49be6a94c1 to your computer and use it in GitHub Desktop.
See openworm/PyOpenWorm issue #91
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/PyOpenWorm/neuron.py b/PyOpenWorm/neuron.py | |
index d693f32..de6a7b4 100644 | |
--- a/PyOpenWorm/neuron.py | |
+++ b/PyOpenWorm/neuron.py | |
@@ -82,7 +82,6 @@ class Connection(P.Property): | |
int | |
The number of connections matching the paramters given | |
""" | |
- # XXX: Turn this into a COUNT query | |
options = dict() | |
options["pre"] = """ | |
?x c:pre_cell ?z . | |
@@ -163,16 +162,17 @@ class Neuron(Cell): | |
def __init__(self, name=False, **kwargs): | |
Cell.__init__(self,name=name,**kwargs) | |
# Get neurons connected to this neuron | |
- Neighbor(owner=self) | |
+ Neighbor(owner=self) | |
# Get connections from this neuron | |
- Connection(owner=self) | |
+ Connection(owner=self) | |
Neuron.DatatypeProperty("type",self, multiple=True) | |
Neuron.DatatypeProperty("receptor", self, multiple=True) | |
Neuron.DatatypeProperty("innexin", self, multiple=True) | |
Neuron.DatatypeProperty("neurotransmitter", self, multiple=True) | |
+ self.neuropeptide = self.neurotransmitter | |
### Aliases ### | |
- self.get_neighbors = self.neighbor | |
+ self.get_neighbors = self.neighbor | |
self.receptors = self.receptor | |
def GJ_degree(self): | |
diff --git a/README.md b/README.md | |
index ce0f808..355f57b 100644 | |
--- a/README.md | |
+++ b/README.md | |
@@ -152,14 +152,14 @@ See what some evidence stated:: | |
``` | |
-See what neurons express some receptor:: | |
+See what neurons express some neuropeptide:: | |
```python | |
>>> n = P.Neuron() | |
- >>> n.receptor("TH") | |
- receptor=TH | |
+ >>> n.neuropeptide("TH") | |
+ neuropeptide=TH | |
- >>> s = set(x.name.one() for x in n.load()) | |
- >>> s == set(['CEPVL','CEPVR','PDEL','PDER','CEPDR']) | |
+ >>> s = set(x.name() for x in n.load()) | |
+ >>> s == set(['CEPDR', 'PDER', 'CEPDL', 'PDEL', 'CEPVR', 'CEPVL']) | |
True | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyOpenWorm as P | |
P.connect("default.conf") | |
n = P.Neuron() | |
n.neuropeptide("TH") | |
print("as in README.md:") | |
n = P.Neuron() | |
print(n.neuropeptide("TH")) | |
s = set(x.name() for x in n.load()) | |
print(s == set(['CEPDR', 'PDER', 'CEPDL', 'PDEL', 'CEPVR', 'CEPVL'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment