{"id":18420597,"url":"https://github.com/openworm/owmeta-movement","last_synced_at":"2025-04-13T09:39:02.024Z","repository":{"id":145390587,"uuid":"325901741","full_name":"openworm/owmeta-movement","owner":"openworm","description":"DataSources and utilities for movement data in OpenWorm","archived":false,"fork":false,"pushed_at":"2021-12-24T23:26:50.000Z","size":156,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-02-16T07:16:38.050Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"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":"2021-01-01T01:51:50.000Z","updated_at":"2023-07-04T06:42:11.000Z","dependencies_parsed_at":"2023-06-03T16:45:14.245Z","dependency_job_id":null,"html_url":"https://github.com/openworm/owmeta-movement","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openworm%2Fowmeta-movement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openworm%2Fowmeta-movement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openworm%2Fowmeta-movement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openworm%2Fowmeta-movement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openworm","download_url":"https://codeload.github.com/openworm/owmeta-movement/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248692320,"owners_count":21146553,"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":[],"created_at":"2024-11-06T04:22:23.286Z","updated_at":"2025-04-13T09:39:02.003Z","avatar_url":"https://github.com/openworm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Dev Test/Deploy](https://github.com/openworm/owmeta-movement/actions/workflows/dev-test.yml/badge.svg)](https://github.com/openworm/owmeta-movement/actions/workflows/dev-test.yml)\n[![Docs](https://readthedocs.org/projects/owmeta-movement/badge/?version=latest)](https://owmeta-movement.readthedocs.io/en/latest)\n[![Coverage Status](https://coveralls.io/repos/github/openworm/owmeta-movement/badge.svg?branch=master)](https://coveralls.io/github/openworm/owmeta-movement?branch=master)\n\nowmeta-movement\n===============\nThis repository contains classes and commands for manipulating, displaying, and\nsharing *C. elegans* movement data, particularly \"tracks\" of movement across a\nplate as can be expressed with [WCON][WCON].\n\n[WCON]: https://github.com/openworm/tracker-commons/\n\nInstall\n-------\nTo get the command line tools (sub-commands to [`owm`][owmeta-cli]) and the\nmovement data types, you can install with pip:\n\n    pip install owmeta-movement\n\nTo ensure support for plotting tracks, install with the `plot`\n[\"extra\"][pep508]:\n\n    pip install owmeta-movement[plot]\n\nLikely, you'll also want the owmeta-movement schema bundle for several of the\ncommands, described further in *Usage* below. To do so, initialize your project\n(if you don't already have one):\n\n    owm init --default-context-id \"http://example.org/movement\"\n\nYou can pick whatever you like for the default context ID. Add `{\"id\":\n\"openworm/owmeta-movement-schema\", \"version\": 4}` to your `.owm/owm.conf`\nfile's `dependencies` list. Your `owm.conf` may look something like this:\n\n    {\n        \"class_registry_context_id\": \"urn:uuid:33c67b01-a865-4ea3-8407-13b69e22e2d3\",\n        \"default_context_id\": \"http://example.org/movement\",\n        \"imports_context_id\": \"urn:uuid:5485296e-83a1-4fad-9518-7106a6a115ee\",\n        \"rdf.source\": \"zodb\",\n        \"rdf.store_conf\": \"$OWM/worm.db\",\n        \"rdf.upload_block_statement_count\": 50,\n        \"dependencies\": [{\"id\": \"openworm/owmeta-movement-schema\", \"version\": 4}]\n    }\n\nThen, you'll need to add a \"remote\" so `owm` knows where to get the bundle\nfrom:\n\n    owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/owmeta-bundles/master/index.json'\n\nOnce you have declared a remote with the `--user` option, as show above, you\nwill not need to declare it again for each new project.\n\n[owmeta-cli]: https://owmeta-core.readthedocs.io/en/latest/command.html\n[pep508]: https://www.python.org/dev/peps/pep-0508/#extras\n\nUsage\n-----\nThe OpenWorm *C. elegans* [movement database][OWMD] has several entries, with\nvarious formats. Sub-commands are defined for dealing with some of them. One\nentry is from the CeMEE MWT dataset, and we'll describe some commands for\nworking with it below. Be sure you've followed the instructions for installing\nthe `openworm/owmeta-movement-schema` bundle above.\n\nFirst, add a [DataSource][datasource] reference to WCON from the CeMEE MWT\ndataset:\n\n    owm movement cemee save 4074963 CeMEE_MWT_founders.tar.gz LSJ2_20190705_105444.wcon.zip --key cemee-mwt-LSJ2_20190705_105444 \n\nThis should return the URI for the created DataSource, which, by default, looks\nlike this:\n\n    http://data.openworm.org/data_sources/ZenodoCeMEEWCONDataSource#cemee-mwt-LSJ2_20190705_105444\n\nbut we'll bind a namespace so we don't have to write the whole string in commands:\n\n    owm namespace bind zenodo_cemee 'http://data.openworm.org/data_sources/ZenodoCeMEEWCONDataSource#'\n\n\nA side effect of this command is *downloading* the referenced file from Zenodo\n-- _this is about 550MB for the file in the command above_. However, if the\ndownload completes, running `owm movement cemee save` for the same record and\nfile should use a version cached in your owmeta project directory, `.owm`.\n\nYou can show the attributes of the source you created with this command:\n\n    owm source show 'zenodo_cemee:cemee-mwt-LSJ2_20190705_105444'\n\nYou can check out some of the metadata in the downloaded WCON:\n\n    import json\n\n    from owmeta_core.command import OWM\n    from owmeta_core.datasource import DataSource\n\n    with OWM().connect() as conn:\n        dsq = conn.owm.default_context.stored(DataSource)(\n                ident='http://data.openworm.org/data_sources/ZenodoCeMEEWCONDataSource#cemee-mwt-LSJ2_20190705_105444')\n        with dsq.load_one().wcon_contents() as f:\n            print(json.load(f)['metadata'])\n\nThen you can translate the WCON from the Zenodo record to the `WormTracks`\nformat, which is essentially a translation of WCON into RDF, which is useful\nfor commands that operate on this generic format. In addition, because CeMEE\n\"WCON\" does not quite conform to the WCON specification, this will also\ntranslate into a compliant form of WCON. To perform the translation, run these\ncommand:\n\n    owm translator create http://schema.openworm.org/2020/07/CeMEEDataTranslator\n    owm movement cemee translate zenodo_cemee:cemee-mwt-LSJ2_20190705_105444\n\nThe latter command should return the identifier for the resulting DataSource:\n\n    http://data.openworm.org/sci/data_sources/DataWithEvidenceDataSource#a86e368bfb698cf16647f441a304d6ec9\n\nThis is also the identifier of the context that imports the context where\nstatements in the DataSource are defined. See documentation for\n[DataWithEvidenceDataSource][DWEDS] for more information. For convenience,\nwe'll add that context as an import to the project:\n\n    owm contexts add-import https://example.org/movement http://data.openworm.org/sci/data_sources/DataWithEvidenceDataSource#a86e368bfb698cf16647f441a304d6ec9\n\nYou can remove the import later with:\n\n    owm contexts rm-import https://example.org/movement http://data.openworm.org/sci/data_sources/DataWithEvidenceDataSource#a86e368bfb698cf16647f441a304d6ec9\n\nSo, finally, for this brief walk-through, you can plot the \"WormTracks\". First, use\nthe `list-tracks` sub-command to get the ID:\n\n    owm movement list-tracks\n\nwhich, for us, yields:\n\n    http://data.openworm.org/sci/bio/movement/WormTracks#aae70bb80b9f6f08528fa08b1e269423f\n\nThen plot it with the `plot` sub-command:\n\n    owm movement plot 'http://data.openworm.org/sci/bio/movement/WormTracks#aae70bb80b9f6f08528fa08b1e269423f'\n\nYou can also plot individual tracks in the dataset.\n\n    owm movement plot 'http://data.openworm.org/sci/bio/movement/WormTracks#aae70bb80b9f6f08528fa08b1e269423f' 1\n\n[OWMD]: https://zenodo.org/communities/open-worm-movement-database/\n[datasource]: https://owmeta-core.readthedocs.io/en/latest/api/owmeta_core.datasource.html#owmeta_core.datasource.DataSource\n[DWEDS]: https://owmeta.readthedocs.io/en/latest/api/owmeta.data_trans.data_with_evidence_ds.html#owmeta.data_trans.data_with_evidence_ds.DataWithEvidenceDataSource\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenworm%2Fowmeta-movement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenworm%2Fowmeta-movement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenworm%2Fowmeta-movement/lists"}