Last active
August 29, 2015 14:14
-
-
Save mwatts15/3600df9be5d2d00e366e to your computer and use it in GitHub Desktop.
See openworm/PyOpenWorm #92
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 sys | |
import PyOpenWorm as P | |
if len(sys.argv) > 1: | |
P.connect(conf={'rdf.source':'default'}) | |
P.loadData('../WormData.n3') | |
else: | |
P.connect('default.conf') | |
def should_match(y, x): | |
print y | |
print " -> Should match {}".format(x) | |
ader = P.Neuron('ADER') | |
should_match(ader.receptors(), "set(['ACR-16', 'TYRA-3', 'DOP-2', 'EXP-1'])") | |
#look up what reference says this neuron has a receptor EXP-1 | |
e = P.Evidence() | |
should_match(e.asserts(P.Neuron('ADER').receptor('EXP-1')), "asserts=receptor=EXP-1") | |
should_match(e.doi(), "'10.100.123/natneuro'") | |
print "Add provenance information::" | |
e = P.Evidence(author='Sulston et al.', date='1983') | |
should_match(e.asserts(P.Neuron(name="AVDL").lineageName("AB alaaapalr")), "asserts=lineageName=AB alaaapalr") | |
e.save() | |
print "See what some evidence stated::" | |
e0 = P.Evidence(author='Sulston et al.', date='1983') | |
should_match(list(e0.asserts()), "lineageName=") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment