{ "info": { "author": "Justas Birgiolas", "author_email": "justas@asu.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "[![Build Status](https://travis-ci.com/JustasB/hoc2swc.svg?branch=master)](https://travis-ci.com/JustasB/hoc2swc)\n[![Coverage Status](https://coveralls.io/repos/github/JustasB/hoc2swc/badge.svg?branch=master)](https://coveralls.io/github/JustasB/hoc2swc?branch=master)\n[![PyPI version](https://badge.fury.io/py/hoc2swc.svg)](https://badge.fury.io/py/hoc2swc)\n\n# hoc2swc: A Python package to convert NEURON cell HOC files to SWC morphology files\n\n[hoc2swc](https://pypi.org/project/hoc2swc/) is a Python library that converts the morphology of neuron models defined using [NEURON simulator](https://neuron.yale.edu) [HOC files](https://www.neuron.yale.edu/neuron/static/new_doc/programming/hocsyntax.html) to the popular [SWC morphology format](http://www.neuronland.org/NLMorphologyConverter/MorphologyFormats/SWC/Spec.html). The library can also be used to convert cell morphologies instantiated in NEURON simulator (e.g. models that were build using NEURON+Python).\n\nOnce converted to SWC, tools that can consume SWC files can be used to [compute SWC morphology metrics](https://pypi.org/project/pylmeasure/), create [professional 3D neuron morphology visualizations](https://github.com/MartinPyka/SWC2Blender), etc...\n\n# Requirements\n\nhoc2swc requires a working version of NEURON either installed from a [package/installer](https://www.neuron.yale.edu/neuron/download) (easier) or [compiled](https://neurojustas.com/2018/03/27/tutorial-installing-neuron-simulator-with-python-on-ubuntu-linux/) (more challenging). Linux, Mac, and Windows versions are supported.\n\nYou must be able to run at least *one* of these commands in a terminal window without errors:\n - `nrniv -python`\n - Or `python -c 'from neuron import h'`\n\nIf you cannot run any of these commands, it indicates that there is something amiss with your NEURON installation. Search the error messages on the [NEURON forum](https://www.neuron.yale.edu/phpBB/) for help.\n\n# Installation and Usage\n\nInstallation and usage depends on how you installed NEURON simulator (installed vs. compiled). More customizable functionality is available for those who compiled.\n\n## If you installed a downloaded NEURON package\nDownload and extract [this hoc2swc ZIP file](https://github.com/JustasB/hoc2swc/archive/master.zip) to a known folder. This folder will have a script named `hoc2swc.py`. Note its location.\n\nThen, to convert a HOC file, run the following command in terminal (note the '-'s before the hoc and swc paths):\n\n`nrniv -python path/to/hoc2swc.py -path/to/cell.hoc -path/to/converted.swc`\n\n## If you compiled NEURON+Python\n\nTo install the library, simply type in `pip install hoc2swc` in your terminal.\n\nThen in a Python session, run the following to convert a HOC file to SWC.\n\n```\nfrom hoc2swc import hoc2swc\n\nhoc2swc(\"path/to/cell.hoc\", \"out.swc\")\n```\n\n### Exporting non-HOC cells\nIf a cell is not defined in a HOC file (e.g. defined using a custom script or using Python), you can instantiate the cell in NEURON and when it is ready for export to SWC, use the following Python script lines:\n\n```\n# Load your cell\nfrom neuron import h\nrun_scripts_build_cell_etc()\n\n# Export loaded cell to SWC\nfrom hoc2swc import neuron2swc\nneuron2swc(\"out.swc\")\n```\n\nNote to packaged NEURON users, if you start `nrniv -python` from the directory where the hoc2swc.py file is located OR append the location to the PYTHONPATH environment variable, the above lines will work for you as well.\n\n# Issues\nIf you encounter an issues, first make sure it's not due to NEURON itself -- this library simply interacts with the NEURON executables. If it is, please contact the [NEURON team](https://www.neuron.yale.edu/phpBB/). If the issue is with this library, please create an [issue on Github](https://github.com/JustasB/hoc2swc/issues).\n\n# Contributing\n\nTo contribute, please open an issue first and discuss your plan for contributing. Then fork this repository and commit a pull-request with your changes.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/justasb/hoc2swc", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "hoc2swc", "package_url": "https://pypi.org/project/hoc2swc/", "platform": "", "project_url": "https://pypi.org/project/hoc2swc/", "project_urls": { "Homepage": "https://github.com/justasb/hoc2swc" }, "release_url": "https://pypi.org/project/hoc2swc/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Convert NEURON simulator .HOC files to .SWC morphology format", "version": "0.1.1" }, "last_serial": 4907181, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "722a52ee400b3563cd617aae87842a09", "sha256": "6dee88d23f4df052f862385c2fd027fdbc19285556eac13b86c64b96d85d007c" }, "downloads": -1, "filename": "hoc2swc-0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "722a52ee400b3563cd617aae87842a09", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7000, "upload_time": "2019-03-06T20:24:37", "url": "https://files.pythonhosted.org/packages/4f/84/4410f4732d123acaaca079ab058ab79d61e6e397df7826c964682492df3d/hoc2swc-0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9e959d4728b0790df7216bfa6b70f96", "sha256": "c8af4e3fb34b3d8e330f3b5641bd72446da37c1417c996930a1aa8f84a6a4997" }, "downloads": -1, "filename": "hoc2swc-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d9e959d4728b0790df7216bfa6b70f96", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6191, "upload_time": "2019-03-06T20:24:39", "url": "https://files.pythonhosted.org/packages/44/1b/e52dd3e0ebfdd58fc6875d48711777b81adb8de2ef287c2baefd6b549c89/hoc2swc-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2186b813ba020f7a2012f81389c474a4", "sha256": "3873a7a2b5ed0258574fbcddaf2475e8cf4f510f890269453819e0f078130686" }, "downloads": -1, "filename": "hoc2swc-0.1.tar.gz", "has_sig": false, "md5_digest": "2186b813ba020f7a2012f81389c474a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6060, "upload_time": "2019-03-06T20:24:40", "url": "https://files.pythonhosted.org/packages/d3/22/b9501b35708fd20718e2014a138a5d27a8f173f908d9170a93167eeb0773/hoc2swc-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "691e5d2ce18085820ac91126de03199a", "sha256": "08304c92824fa44147dceddba3dd0cf9e0ae116c917d1fd2e2faf4e7bb7493be" }, "downloads": -1, "filename": "hoc2swc-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "691e5d2ce18085820ac91126de03199a", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7645, "upload_time": "2019-03-06T21:13:05", "url": "https://files.pythonhosted.org/packages/54/a3/46b3c8ffd8943ffded2016c9c7cf4af48b574d97377a464c3aab82ab12b2/hoc2swc-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e15939aaa53277debfd059e98d3a03b9", "sha256": "31e48e20f605d9317da4ffc00fdcf003a53094dcd1c80ceffe42b8642fc4c288" }, "downloads": -1, "filename": "hoc2swc-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e15939aaa53277debfd059e98d3a03b9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6832, "upload_time": "2019-03-06T21:13:06", "url": "https://files.pythonhosted.org/packages/c2/56/69d046c2f1dcea40284e8bf8a818c4a7778b57327b147dc7b9a23e7718c3/hoc2swc-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e45184f4d0a5b70029e6f032faee7fa9", "sha256": "097a3524913c1344841afe731cd5d6084e6da83414f069c816b4451d282cc52f" }, "downloads": -1, "filename": "hoc2swc-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e45184f4d0a5b70029e6f032faee7fa9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6340, "upload_time": "2019-03-06T21:13:07", "url": "https://files.pythonhosted.org/packages/80/e9/879dc5f4458555752a037fdd0424091f0d4fea99b0dfa7933e441ec80c4b/hoc2swc-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "691e5d2ce18085820ac91126de03199a", "sha256": "08304c92824fa44147dceddba3dd0cf9e0ae116c917d1fd2e2faf4e7bb7493be" }, "downloads": -1, "filename": "hoc2swc-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "691e5d2ce18085820ac91126de03199a", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7645, "upload_time": "2019-03-06T21:13:05", "url": "https://files.pythonhosted.org/packages/54/a3/46b3c8ffd8943ffded2016c9c7cf4af48b574d97377a464c3aab82ab12b2/hoc2swc-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e15939aaa53277debfd059e98d3a03b9", "sha256": "31e48e20f605d9317da4ffc00fdcf003a53094dcd1c80ceffe42b8642fc4c288" }, "downloads": -1, "filename": "hoc2swc-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e15939aaa53277debfd059e98d3a03b9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6832, "upload_time": "2019-03-06T21:13:06", "url": "https://files.pythonhosted.org/packages/c2/56/69d046c2f1dcea40284e8bf8a818c4a7778b57327b147dc7b9a23e7718c3/hoc2swc-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e45184f4d0a5b70029e6f032faee7fa9", "sha256": "097a3524913c1344841afe731cd5d6084e6da83414f069c816b4451d282cc52f" }, "downloads": -1, "filename": "hoc2swc-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e45184f4d0a5b70029e6f032faee7fa9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6340, "upload_time": "2019-03-06T21:13:07", "url": "https://files.pythonhosted.org/packages/80/e9/879dc5f4458555752a037fdd0424091f0d4fea99b0dfa7933e441ec80c4b/hoc2swc-0.1.1.tar.gz" } ] }