{"id":13726527,"url":"https://github.com/openworm/owmeta","last_synced_at":"2025-04-05T06:10:36.363Z","repository":{"id":13156050,"uuid":"15838785","full_name":"openworm/owmeta","owner":"openworm","description":"Unified, simple data access python library for data \u0026 facts about C. elegans anatomy","archived":false,"fork":false,"pushed_at":"2024-07-29T17:49:16.000Z","size":5217,"stargazers_count":155,"open_issues_count":49,"forks_count":49,"subscribers_count":31,"default_branch":"dev","last_synced_at":"2025-03-29T05:06:38.147Z","etag":null,"topics":["metadata","rdf"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openworm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-12T08:09:01.000Z","updated_at":"2025-03-26T11:34:30.000Z","dependencies_parsed_at":"2024-01-09T06:13:41.551Z","dependency_job_id":"30f6a5f7-d6d2-40be-bbe3-87a1ce3d42a8","html_url":"https://github.com/openworm/owmeta","commit_stats":null,"previous_names":["openworm/pyopenworm"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openworm%2Fowmeta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openworm%2Fowmeta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openworm%2Fowmeta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openworm%2Fowmeta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openworm","download_url":"https://codeload.github.com/openworm/owmeta/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247086024,"owners_count":20881160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["metadata","rdf"],"created_at":"2024-08-03T01:03:10.546Z","updated_at":"2025-04-05T06:10:36.335Z","avatar_url":"https://github.com/openworm.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![Build Status](https://github.com/openworm/owmeta/actions/workflows/dev-test.yml/badge.svg)](https://github.com/openworm/owmeta/actions/workflows/dev-test.yml)\n[![Docs](https://readthedocs.org/projects/owmeta/badge/?version=latest)](https://owmeta.readthedocs.io/en/latest)\n[![Coverage Status](https://coveralls.io/repos/github/openworm/owmeta/badge.svg?branch=dev)](https://coveralls.io/github/openworm/owmeta?branch=dev)\n\nowmeta \n======\n\u003cimg width=\"1207\" alt=\"pyow_in_overview\" src=\"openworm-overview.png\"\u003e\n\nA data access layer in Python which integrates disparate structures and\nrepresentations for *C. elegans* anatomy and physiology. Enables a simple\nPython API for asking various questions about the cells of the *C. elegans* and\nenabling data sharing for the purpose of building a [data-to-model\npipeline](http://docs.openworm.org/en/latest/projects) for the\n[OpenWorm](http://www.openworm.org) project.\n\nOverview\n--------\n\u003cimg align=\"left\" width=\"128\" alt=\"owmeta_logo\" src=\"owmeta-logo.min.svg\"/\u003e\n\nThe data and models required to simulate *C. elegans* are highly heterogeneous.\nConsequently, from a software perspective, a variety of underlying\nrepresentations are needed to store different aspects of the relevant anatomy\nand physiology.  For example, a NetworkX representation of the connectome as a\ncomplex graph enables questions to be asked about nearest neighbors of a given\nneuron.  An RDF semantic graph representation is useful for reading and writing\nannotations about multiple aspects of a neuron, such as what papers have been\nwritten about it, properties it may have such as ion channels and\nneurotransmitter receptors, etc.  A NeuroML representation is useful for\nanswering questions about model morphology and simulation parameters.  A\nBlender representation is a full 3D shape definition that can be used for\ncalculations in 3D space.\n\nThe diversity of underlying representations required for OpenWorm presents a\nchallenge for data integration and consolidation.  owmeta solves this\nchallenge with a unified data access layer whereby different representations\nare encapsulated into an abstract view.  This allows the user to work with\nobjects related to the *biological reality of the worm*, and forget about which\nrepresentation is being used under the hood.  The worm itself has a unified\nsense of neurons, networks, muscles, ion channels, etc. and so should our code.\n\nRelationship to ChannelWorm2\n-----------------------------\n[ChannelWorm2](https://github.com/openworm/ChannelWorm2) is the sub-project of\nOpenWorm which houses ion channel models. In the future, we expect\nChannelWorm2 to be a \"consumer\" of owmeta. An owmeta database will house\nphysical models, the digitized plots they are derived from (there is a Plot\ntype in owmeta), and provide code to put those models into enumerated formats\nalong with auxiliary files or comments. However, because these projects were\nnot developed sequentially, there is currently some overlap in functionality,\nand owmeta itself houses a fairly substantial amount of physiological\ninformation about *C. elegans.* Ultimately, the pure core of owmeta, which is\nmeant to be a data framework for storing metadata and provenance (i.e.\nparameters and trajectories associated with simulations), will be separated out\ninto standalone functionality.\n\nVersioning data as code\n-----------------------\n\nA library that attempts to reliably expose dynamic data can often be broken\nbecause the underlying data sets that define it change over time.  This is\nbecause data changes can cause queries to return different answers than before,\ncausing unpredictable behavior.\n\nAs such, to create a stable foundational library for others to reuse, the\nversion of the owmeta library guarantees the user a specific version of the\ndata behind that library.  In addition, unit tests are used to ensure basic\nsanity checks on data are maintained.  As data are improved, the maintainers of\nthe library can perform appropriate regression tests prior to each new release\nto guarantee stability.\n\nInstallation\n------------\n\nSee INSTALL.md\n\nQuickstart\n-----------\n\nTo get started, you'll need to connect to a database. The OpenWorm owmeta\n\"project\" is currently hosted at `https://github.com/openworm/OpenWormData.git`.\nThis project holds a working-copy of the database. You can retrieve it by\nexecuting the following command line after owmeta installation:\n\n```bash\nowm clone https://github.com/openworm/OpenWormData.git --branch owmeta\n```\n\nThis command should create a directory `.owm` in your current working\ndirectory. Then, in Python, from the same working directory:\n```python\n\u003e\u003e\u003e from owmeta_core.command import OWM\n\u003e\u003e\u003e conn = OWM().connect()\n\n```\n\nThis creates a connection to the project stored under the `.owm` directory.\n\nThen you can try out a few things:\n\n```python\n# Make the context\n\u003e\u003e\u003e from owmeta_core.context import Context\n\u003e\u003e\u003e ctx = conn(Context)(ident='http://openworm.org/data')\n\n# Grab the representation of the neuronal network\n\u003e\u003e\u003e from owmeta.worm import Worm\n\u003e\u003e\u003e net = ctx.stored(Worm).query().neuron_network()\n\n# Grab a specific neuron\n\u003e\u003e\u003e from owmeta.neuron import Neuron\n\u003e\u003e\u003e aval = ctx.stored(Neuron).query(name='AVAL')\n\n# Get the neuron's type\n\u003e\u003e\u003e aval.type.one()\n'interneuron'\n\n# Count how many connections come from AVAL\n\u003e\u003e\u003e aval.connection.count('pre')\n86\n\n```\n\nMore examples\n-------------\n\nReturn information about individual neurons:\n\n```python\n\u003e\u003e\u003e aval.name()\n'AVAL'\n\n# List all known receptors\n\u003e\u003e\u003e sorted(aval.receptors())\n['GGR-3', 'GLR-1', ... 'NPR-4', 'UNC-8']\n\n# Show how many chemical synapses go in and out of AVAL\n\u003e\u003e\u003e aval.connection.count('either', syntype='send')\n105\n\n```\n\nReturn the list of all neurons:\n\n```python\n\u003e\u003e\u003e len(set(net.neuron_names()))\n302\n\u003e\u003e\u003e sorted(net.neuron_names())\n['ADAL', 'ADAR', ... 'VD8', 'VD9']\n\n```\n\nReturn a set of all muscles:\n\n```python\n\u003e\u003e\u003e muscles = ctx.stored(Worm).query().muscles()\n\u003e\u003e\u003e len(muscles)\n158\n\n```\nBecause the ultimate aim of OpenWorm is to be a platform for biological\nresearch, the physiological data in owmeta should be uncontroversial and\nwell supported by evidence. Using the Evidence type, it is possible to link\ndata and models to corresponding articles from peer-reviewed literature:\n\n```python\n\u003e\u003e\u003e from owmeta.document import Document\n\u003e\u003e\u003e from owmeta.evidence import Evidence\n\n# Make a context for evidence (i.e., statements about other groups of statements)\n\u003e\u003e\u003e evctx = conn(Context)(ident='http://example.org/evidence/context')\n\n# Make a context for defining domain knowledge\n\u003e\u003e\u003e dctx = evctx(Context)(ident='http://example.org/data/context')\n\u003e\u003e\u003e doc = evctx(Document)(key=\"Sulston83\", author='Sulston et al.', date='1983')\n\u003e\u003e\u003e e = evctx(Evidence)(key=\"Sulston83\", reference=doc)\n\u003e\u003e\u003e avdl = dctx(Neuron)(name=\"AVDL\")\n\u003e\u003e\u003e avdl.lineageName(\"AB alaaapalr\")\nowmeta_core.statement.Statement(subj=Neuron(ident=rdflib.term.URIRef('http://data.openworm.org/sci/bio/Neuron#AVDL')), prop=owmeta.cell.Cell_lineageName(owner=Neuron(ident=rdflib.term.URIRef('http://data.openworm.org/sci/bio/Neuron#AVDL'))), obj=owmeta_core.dataobject_property.ContextualizedPropertyValue(rdflib.term.Literal('AB alaaapalr')), context=owmeta_core.context.Context(ident=\"http://example.org/data/context\"))\n\u003e\u003e\u003e e.supports(dctx.rdf_object)\nowmeta_core.statement.Statement(subj=Evidence(ident=rdflib.term.URIRef('http://data.openworm.org/Evidence#Sulston83')), prop=owmeta.evidence.Evidence_supports(owner=Evidence(ident=rdflib.term.URIRef('http://data.openworm.org/Evidence#Sulston83'))), obj=ContextDataObject(ident=rdflib.term.URIRef('http://example.org/data/context')), context=owmeta_core.context.Context(ident=\"http://example.org/evidence/context\"))\n\u003e\u003e\u003e with conn.transaction_manager:\n...     dctx.save_context()\n...     evctx.save_context()\n\n```\n\nRetrieve evidence:\n```python\n\u003e\u003e\u003e doc = evctx.stored(Document)(author='Sulston et al.', date='1983')\n\u003e\u003e\u003e e0 = evctx.stored(Evidence)(reference=doc)\n\u003e\u003e\u003e supported_ctx = e0.supports()\n\n# is the neuron's presence asserted?\n\u003e\u003e\u003e dctx.identifier == supported_ctx.identifier\nTrue\n\n```\n\nQuery for neurons in *C. elegans*:\n```python\n\u003e\u003e\u003e from owmeta.network import Network\n\n# The default Worm() is for C. elegans\n\u003e\u003e\u003e with ctx.stored(Worm, Neuron, Network) as cctx:\n...     w = cctx.Worm()\n...     net = cctx.Network()\n...     w.neuron_network(net)\nowmeta_core.statement.Statement(subj=Worm(ident=rdflib.term.URIRef('http://data.openworm.org/sci/bio/Worm#a8020ed8519038a6bbc98f1792c46c97b')), prop=owmeta.worm.Worm_neuron_network(owner=Worm(ident=rdflib.term.URIRef('http://data.openworm.org/sci/bio/Worm#a8020ed8519038a6bbc98f1792c46c97b'))), obj=Network(ident=rdflib.term.URIRef('http://data.openworm.org/sci/bio/Network#a5859bb1e51537f60e506c283401fcd84')), context=owmeta_core.context.QueryContext(ident=\"http://openworm.org/data\"))\n\n...     neur = cctx.Neuron.query()\n...     net.neuron(neur)\n...     neur.count()\n302\n\n```\n\nSee what neurons express a given neuropeptide:\n```python\n\u003e\u003e\u003e n = ctx.stored(Neuron).query()\n\u003e\u003e\u003e n.neuropeptide(\"INS-26\")\nowmeta_core.statement.Statement(subj=Neuron(ident=rdflib.term.Variable('aNeuron_...')), prop=owmeta.neuron.Neuron_neuropeptide(owner=Neuron(ident=rdflib.term.Variable('aNeuron_...'))), obj=owmeta_core.dataobject_property.ContextualizedPropertyValue(rdflib.term.Literal('INS-26')), context=owmeta_core.context.QueryContext(ident=\"http://openworm.org/data\"))\n\n\u003e\u003e\u003e sorted(x.name() for x in n.load())\n['ASEL', 'ASER', 'ASIL', 'ASIR']\n\n```\n\nGet direct access to the RDFLib graph:\n```python\n\u003e\u003e\u003e conn.rdf.query(\"SELECT ?y WHERE { ?x rdf:type ?y }\")\n\u003crdflib.plugins.sparql.processor.SPARQLResult object at ...\u003e\n\n```\n\nModeling data\n-------------\n\nAs described above, ultimately, ion channel models will be part of the\nChannelWorm2 repository. As the project evolves, other models, such as for\nreproduction and development, may be housed in their own repositories. But for\nthe time being, the owmeta repository contains specific models as well. These\nmodels will eventually be transferred to an appropriate and independent data\nrepository within the OpenWorm suite of tools.\n\n\n\n```python\n# Get data for a subtype of voltage-gated potassium channels\n\u003e\u003e\u003e from owmeta.channel import Channel\n\u003e\u003e\u003e kv1 = ctx(Channel)(subfamily='Kv1.1')\n\u003e\u003e\u003e kv1.models()\n\n```\n\nThe same type of operation can be used to obtain the experimental data a given\nmodel was derived from.\n\n```python\n# Get experiment(s) that back up the data model\n\u003e\u003e some_model = mods[0]\n\u003e\u003e some_model.references.get()\n\n```\n\nFinally, when you're done accessing the database, be sure to disconnect from it:\n```python\n\u003e\u003e\u003e conn.disconnect()\n\n```\n\nMore examples can be found [in the owmeta-core\ndocumentation](https://owmeta-core.readthedocs.io/en/latest/making_dataObjects.html)\nand [in the ./examples directory of the owmeta Git\nrepository](https://github.com/openworm/owmeta/tree/master/examples).\n\nDocumentation\n-------------\n\nFurther documentation [is available online](http://owmeta.readthedocs.io).\n\nContributing\n------------\nWe happily welcome pull requests and [bug\nreports](https://github.com/openworm/owmeta/issues/new). If, you are not\nsure how you can contribute, fill out this (short)\n[form](https://docs.google.com/forms/d/e/1FAIpQLSdzVilyRX3z9e0PeAoQdXhBDiNXp2ugqpnT536xA2iQbLNymQ/viewform?formkey=dC1CUDQtTV82MEJJcjY0NjdCcHpYdmc6MQ#gid=0),\nand you'll receive an invite to our Slack chat where you can initiate more\nin-depth conversations.\n\n\nQuestions/Concerns?\n-------------------\nYou can ask questions, leave bug reports, or propose features on [our issue\ntracker](https://github.com/openworm/owmeta/issues/new).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenworm%2Fowmeta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenworm%2Fowmeta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenworm%2Fowmeta/lists"}