openworm / c302 Goto Github PK
View Code? Open in Web Editor NEWThe c302 framework for generating multiscale network models of C. elegans
Home Page: https://www.opensourcebrain.org/projects/c302
The c302 framework for generating multiscale network models of C. elegans
Home Page: https://www.opensourcebrain.org/projects/c302
Relative imports break in possibly unexpected ways when you run a script from inside of its package directory rather than let python do it for you with -m
This is for the Readme, in Usage Examples: Section 2) Use command line interface to create new network
Specifically, for this command line example code:
c302 MyNetwork parameters_C -cells ["AVBR","VD3"] -cellstostimulate ["AVBR"] -paramoverride {"unphysiological_offset_current":"2.9pA"} -duration 300
There's a lot of things going on here. I had some issue with owmeta that I dont recall what they were.
The wrapt package that was setup on my system, I guess when I installed this, was too new. I had to downgrade to version 1.11.1.
Now I'm getting this:
ImportError: cannot import name inspect.formatargspec. I guess the code, or one of its dependencies, is trying to use the formatargspec function from the inspect module, which has been deprecated and removed in Python 3.11. I'm reading that the inspect.signature function replaced it.
If I try to correct that code on my system, I think I will get sucked into a rabbit hole because I do not know the design of this software.
Reason I want to use this functionality
I was wanting to do a variation on that command in order to generate the LEMS files, and I guess the NeuroML 2 files, for each neuron for a script that:
These tests would be ran on one neuron each. Not to simulate the interactions between the neurons.
Is there another way I can generate that LEMS file, such as another program, or the possibility of running that command from the openworm docker image?
I don't know how to run the command from the openworm docker image, if doing that is possible. But I can figure it out if the other stuff I am trying does not work. Right now I am setting up older versions of linux in virtual machines trying to find one that is not too old to prevent me from installing this program in it, while not being too new to run that command.
Should accept a DataWithEvidenceDataSource identifier for the source of
neuron network and muscle data, etc.
blocked by #12
Many image files in this repo are stored using git lfs, needs to be something in the README about this...
hello
I am try to install c302 according to README.md
I have done:
git clone https://github.com/openworm/c302.git
cd c302
python setup.py install
when I try to run
owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/owmeta-bundles/master/index.json'
so I turned to run
~/opt/anaconda3/bin/owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/owmeta-bundles/master/index.json'
but afterwards, when I try to run the quick test
python c302/c302_Pharyngeal.py
I get the error of:
(The ! mark is because I added something to the dataobject.py file like this:
)
can you please give me advice to overcome this?
Thanks a lot
Hello everyone!
I think it would be useful to made a readme.txt in the data folders to account about the data provenance.
Anyway, could anyone tell me where is the data coming from:
I am using neuroML2 models of neurons, herm_full_edgelist_MODIFIED, and CElegansNeuronTables.csv.
Thanks!
I called the command
c302 -h
And found this error
FileNotFoundError: [Errno 2] No such file or directory: '/Users/username/PyOpenWorm/.pow/worm.db.lock' Failed to open the data source because: Could not open the database file "/Users/username/PyOpenWorm/.pow/worm.db"
c302 >>> Can't connect to PyOpenWorm: ...
PyOpenWorm connection failed: Could not open the database file "/Users/username/PyOpenWorm/.pow/worm.db". Perhaps you need to do a "pow clone"?
It seems like c302 cannot connect to PyOpenWorm. Where can I access this database?
In method names in particular, but possibly subtler distinctions as well.
Hello,
I tried to use sibernetic_c302.py to simulate C. eleganse,
but error occurred.
Collecting c302
Using cached c302-0.7.0.tar.gz (35.1 MB)
Requirement already satisfied: numpy in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from c302) (1.19.4)
Requirement already satisfied: xlrd in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from c302) (2.0.1)
Collecting xlwt
Using cached xlwt-1.3.0-py2.py3-none-any.whl (99 kB)
Requirement already satisfied: libNeuroML>=0.2.39 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from c302) (0.2.53)
Requirement already satisfied: pyNeuroML>=0.3.11 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from c302) (0.5.5)
Collecting pyopenworm==0.7.1
Using cached PyOpenWorm-0.7.1.tar.gz (339 kB)
Requirement already satisfied: lxml in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from libNeuroML>=0.2.39->c302) (4.6.2)
Requirement already satisfied: six in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from libNeuroML>=0.2.39->c302) (1.15.0)
Requirement already satisfied: argparse in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyNeuroML>=0.3.11->c302) (1.4.0)
Requirement already satisfied: pylems>=0.4.9.1 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyNeuroML>=0.3.11->c302) (0.5.1)
Requirement already satisfied: airspeed==0.5.4dev-20150515 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyNeuroML>=0.3.11->c302) (0.5.4.dev20150515)
Requirement already satisfied: neuromllite>=0.1.9 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyNeuroML>=0.3.11->c302) (0.1.9)
Requirement already satisfied: kiwisolver<=1.1.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyNeuroML>=0.3.11->c302) (1.1.0)
Requirement already satisfied: matplotlib in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyNeuroML>=0.3.11->c302) (3.3.3)
Collecting bibtexparser==0.6.1
Using cached bibtexparser-0.6.1.tar.gz (26 kB)
Collecting BTrees==4.0.8
Using cached BTrees-4.0.8.tar.gz (608 kB)
DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
ERROR: Command errored out with exit status 1:
command: 'C:\Users\USER\AppData\Local\Programs\Python\Python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\USER\\AppData\\Local\\Temp\\pycharm-packaging\\btrees\\setup.py'"'"'; __file__='"'"'C:\\Users\\USER\\AppData\\Local\\Temp\\pycharm-packaging\\btrees\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\USER\AppData\Local\Temp\pip-pip-egg-info-kckznqqe'
cwd: C:\Users\USER\AppData\Local\Temp\pycharm-packaging\btrees\
Complete output (46 lines):
WARNING: The wheel package is not available.
ERROR: Command errored out with exit status 1:
command: 'C:\Users\USER\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\USER\\AppData\\Local\\Temp\\pip-wheel-rczjvzy3\\persistent\\setup.py'"'"'; __file__='"'"'C:\\Users\\USER\\AppData\\Local\\Temp\\pip-wheel-rczjvzy3\\persistent\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\USER\AppData\Local\Temp\pip-wheel-h6lc6nk8'
cwd: C:\Users\USER\AppData\Local\Temp\pip-wheel-rczjvzy3\persistent\
Complete output (8 lines):
WARNING: The wheel package is not available.
WARNING: The wheel package is not available.
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Failed building wheel for persistent
ERROR: Failed to build one or more wheels
Traceback (most recent call last):
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\installer.py", line 126, in fetch_build_egg
subprocess.check_call(cmd)
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\USER\\AppData\\Local\\Temp\\tmpuvxibmva', '--quiet', 'persistent']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\USER\AppData\Local\Temp\pycharm-packaging\btrees\setup.py", line 116, in <module>
setup(name='BTrees',
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\__init__.py", line 152, in setup
_install_setup_requires(attrs)
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\__init__.py", line 147, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 673, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 764, in resolve
dist = best[req.key] = env.best_match(
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 1049, in best_match
return self.obtain(req, installer)
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 1061, in obtain
return installer(requirement)
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 732, in fetch_build_egg
return fetch_build_egg(self, req)
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\installer.py", line 128, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\USER\\AppData\\Local\\Temp\\tmpuvxibmva', '--quiet', 'persistent']' returned non-zero exit status 1.
I thought it's maybe the problem of the latest version,
so I tried to download 0.6.0 version of c302
Collecting c302==0.6.0
Using cached c302-0.6.0.tar.gz (642 kB)
DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
ERROR: Command errored out with exit status 1:
command: 'C:\Users\USER\AppData\Local\Programs\Python\Python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\USER\\AppData\\Local\\Temp\\pycharm-packaging\\c302\\setup.py'"'"'; __file__='"'"'C:\\Users\\USER\\AppData\\Local\\Temp\\pycharm-packaging\\c302\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\USER\AppData\Local\Temp\pip-pip-egg-info-evn57mh0'
cwd: C:\Users\USER\AppData\Local\Temp\pycharm-packaging\c302\
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\USER\AppData\Local\Temp\pycharm-packaging\c302\setup.py", line 6, in <module>
import c302
File "C:\Users\USER\AppData\Local\Temp\pycharm-packaging\c302\c302\__init__.py", line 1416
print 555522
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(555522)?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the 'C:\Users\USER\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.
But an even weirder error occurred.
Please help...
There's a test.sh script (which also doesn't work with the python 3
updates) that does not have clear pass/fail which is unhelpful for quickly
diagnosing errors.
This command in the README:
c302 MyNetwork parameters_C -cells ["AVBR","VD3"] -cellstostimulate ["AVBR"] -paramoverride {"unphysiological_offset_current":"2.9pA"} -duration 300
Does not execute as-is in some shells, like ZSH, which attempt to parse ["AVBR","VD3"]
as a shell glob and fail. (For ZSH, the failure produces a message, zsh: no matches found: [AVBR,VD3]
, rather than removing quote marks and passing [AVBR,VD3]
to c302 as Bash apparently does.) ["AVBR"]
is handled similarly. On the other hand, {"unphysiological_offset_current":"2.9pA"}
apparently isn't interpreted as a glob and is handled as intended.
I installed c302, following the instructions. When running to create a new network. I entered the following command.
c302 MyNetwork parameters_C -cells ["AVBR","VD3"] -cellstostimulate ["AVBR"] -paramoverride {"unphysiological_offset_current":"2.9pA"} -duration 300
Depends on openworm/owmeta#467
As a first approximation, can just hard-code
<http://openworm.org/entities/bio#worm0>
as the context to query against (it's sort of the 'top-level' context
produced by insert_worm.py into the OpenWormData repo). Will be modified in
owupd1 to its final form.
Hello, respected developer. I have two questions. The first one is that I want to transplant the neural network computation of C302 to my neural morphology chip. However, currently my neural morphology chip only supports C language, so how can I use C language to reconstruct the network structure of C302 and perform computation on my chip.
Secondly, I am currently well aware that the definition of network structure and neural network calculations that rely on stimulating cells all come from LEMS files, such as LEMS_c302_A_Full.xml. But when I was reading the LEMS file, I found that I couldn't find the three files described in the following code in the local environment, so I would like to ask where these three files are located.
<Include file="Cells.xml" />
<Include file="Networks.xml" />
<Include file="Simulation.xml" />
OpenWormReader will undoubtedly take longer. Must determine whether the
difference is substatial enough to merit doing query of the PyOW database
at a different phase (i.e., with a pow translate
). This had been a
limiting factor to inclusion in c302/CElegansNeuroML previously.
blocked by #10
PyOpenWorm has a notion of DataTranslators that describe how data get from
one form to another and each of those forms is called a DataSource. A
DataSource should be created to describe the input to c302 and a DataSource
should be created to describe the output NeuroML files. The DataTranslator
should have a translate
method which runs c302 with the first DataSource
type and outputs the second. The first DataSource should have a Translation
linking it back to the PyOpenWorm insert_worm DataSource (TBD:
openworm/owmeta#364).
blocked by openworm/owmeta#364
@mwatts15 Could you have a quick look at the installation of owmeta as used in the CI test here: https://github.com/openworm/c302/blob/development/.github/workflows/non_omv.yml#L23?
It fails: https://github.com/openworm/c302/runs/4035587014?check_suite_focus=true with an error:
owmeta_core.bundle.exceptions.BundleNotFound: Missing bundle "openworm/owmeta-data" at version 6: Bundle directory, "/home/runner/.owmeta/bundles/openworm%2Fowmeta-data/6", does not exist for the specified version
but the dir /home/runner/.owmeta/bundles/openworm%2Fowmeta-data/1 does exist
Hello
now i am trying to simulate the c302 neurons of the worm.
so i have done :
git clone https://github.com/openworm/c302.git
cd c302
python setup.py install
sh test.sh
and i got the error in attachment
can you please give me advice
Need to move tests on this from travis-ci.org to travis-ci.com. They will eventually move to github actions, but as a short term solution (since travis-ci.org will shut on June 15th) tests can be moved to travis-ci.com.
This seems to be set up in Settings, but there is a block on this under Third Party Access
@mwatts15 It has you down as requesting this. Any reason not to grant access to this?
In Python 3, such imports do not work any longer.
Explicit relative import:
from . import bioparameters
Allows to configure readers in any way that's needed prior to use (e.g.,
the spreadsheet location, PyOW context). There doesn't seem to be any
reason that users of the data reader either need to initialize or resolve
the readers differently for a given name, so it's better not to expect them
to.
Add to https://github.com/openworm/c302/blob/master/setup.py
Add a new test after OpenWormReader to https://github.com/openworm/c302/blob/master/.github/workflows/non_omv.yml
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.