openworm / owmeta

Unified, simple data access python library for data & facts about C. elegans anatomy
MIT License
152 stars 49 forks source link

implement Neuron.add_reference #5

Closed slarson closed 10 years ago

slarson commented 10 years ago

Spec is:

Add a reference that provides evidence of the relationship between this neuron and one of its elements.
    Example::
    >>>aval = PyOpenWorm.Neuron('AVAL')
    >>>aval.receptors()
    ['GLR-1', 'NMR-1', 'GLR-4', 'GLR-2', 'GGR-3', 'UNC-8', 'GLR-5', 'NMR-2']
    #look up what reference says this neuron has a receptor GLR-1
    >>>aval.get_reference(0,'GLR-1')
    None
    >>>aval.add_reference(0,'GLR-1', doi='125.41.3/ploscompbiol', pmid = '57182010')
    >>>aval.get_reference(0,'GLR-1')
    ['http://dx.doi.org/125.41.3/ploscompbiol', 'http://pubmedcentral.nih.gov/57182010']
    :param type: The kind of thing to add.  Valid options are: 0=receptor, 1=neighbor 
    :param item: Name of the item
    :param doi: A Digital Object Identifier (DOI) that provides evidence, optional
    :param pmid: A PubMed ID (PMID) that point to a paper that provides evidence, optional
    :param wormbaseid: An ID from WormBase that points to a record that provides evidence, optional

stub is here: https://github.com/openworm/PyOpenWorm/blob/master/PyOpenWorm/neuron.py#L289

mwatts15 commented 10 years ago

See: https://github.com/openworm/PyOpenWorm/blob/alpha0.5/examples/add_reference.py