Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindSim package on PyPi #19

Open
wants to merge 33 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c734b8d
Update README.md
MelanieIStefan May 14, 2018
0911405
Merge pull request #1 from MelanieIStefan/patch-1
dilawar Aug 18, 2018
cb28da1
Added framework for fEPSP to findSim. Added a demo in TestTSV
upibhalla Nov 21, 2018
14011d1
Merge branch 'develop' of https://github.com/BhallaLab/FindSim into d…
upibhalla Nov 21, 2018
94a3211
Better implementation for fieldEPSPs, using an integral function to a…
upibhalla Nov 25, 2018
ad59fb0
Fixes to FindSim and some model files so that we can correctly handle…
upibhalla Feb 28, 2019
a09dd98
Further fixes to findSim for multiscale models. Also a fix to the mod…
upibhalla Mar 1, 2019
f128df2
Fixes to findSim and multi_param_minimization to deal with long-stand…
upibhalla Apr 25, 2019
0f09020
fixes to syntax.
Jun 11, 2019
21e2b62
ready for testing.
Jun 11, 2019
987f130
test installation [skip ci]
Jun 11, 2019
ef1869b
Local tests have passed.
Jun 11, 2019
5f44af8
tweaks to readme file.
Jun 11, 2019
e68e4c3
Alpha release.
Jun 11, 2019
c4093e3
ready for alpha testing.
Jun 11, 2019
d1a2084
Merge branch 'master' of https://github.com/BhallaLab/FindSim into pypi
Jun 11, 2019
102480e
Update to README files.
Jun 11, 2019
30bdd2e
Merge branch 'stable' into pypi
Jun 11, 2019
f7a6c93
Revered back to stable version.
Jun 11, 2019
929e106
Added mpld3 and networkx to dependencies.
Jun 11, 2019
82b675f
Fixes to make sure that findSim.py and runAllParallel.py can also be
Jun 11, 2019
5f14c18
virtualenv error on travis.
Jun 11, 2019
678895f
typo.
Jun 11, 2019
0861074
Install pylint as well.
Jun 11, 2019
a924bd5
Use latest moose, else tests will fail. 3.1.4 (last stable) is not over
Jun 11, 2019
c273946
use timeout when running in paralle.
Jun 11, 2019
6ef4bc2
old command line executing and new module based executing are working
Jun 11, 2019
79c07ae
bumped version for PyPI.
Jun 11, 2019
38c210d
Merge branch 'pypi' of https://github.com/BhallaLab/FindSim into pypi
Jun 11, 2019
e429f0d
Version bumped after merging.
Jun 11, 2019
73a6bcc
disable +x from the test script. Ready to be reviewed.
Jun 11, 2019
d738049
HOTFIX: Some fixes from static code anaylysis. Variables names were n…
Jun 14, 2019
ffedc84
pylint is now strict; and it ignore mehtod overshadow created by mpl3d
Jun 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ before_script:

script:
- cp ./.travis/matplotlibrc .
- ./test.sh
- python -m pip install .
- python -m pip install pymoose --pre --upgrade # till we relase 3.2.0
- ./test.sh
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include . *.xml
228 changes: 157 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,99 +14,185 @@ provides a score that reports how closely the two match.
# LICENSE
This file and the files in this repository are licensed under GPL v3 or later.

# Version
# Install

Latest release is 1.1.0, which can be downloadable at
https://github.com/BhallaLab/FindSim/archive/v1.1.0.zip
https://github.com/BhallaLab/FindSim/archive/v1.1.0.tar.gz
One can get `FindSim` using `python-pip`.

To install last stable release (__NOTE__ This uses moose version 3.1.4 (outdated
with this release))

$ pip install FindSim

Or, to install the nightly built,

$ pip install FinSim --pre # recommended

Alternatively, you can download the source code and install it yourself.

1. Install MOOSE which can be found here https://moose.ncbs.res.in/readthedocs/install/install.html
2. Install FindSim

```
git clone https://github.com/BhallaLab/FindSim
cd FindSim
python setup.py install
```

After successful installation, two commands are available at your disposal
`findsim` and `findsim_parallel`. To see the help message, pass `-h` option to
either of these commands. For example, `findsim -h` will show you following
message.

```
usage: findsim [-h] [-m MODEL] [-d DUMP_SUBSET] [-p PARAM_FILE] [-t] [-hp]
[-hs] [-o] [-s SCALE_PARAM SCALE_PARAM SCALE_PARAM]
[-settle_time SETTLE_TIME]
script

FindSim argument parser This program loads a kinetic model, and runs it with
the specified stimuli. The output is then compared with expected output
specified in the same file, to generate a model score.

positional arguments:
script Required: filename of experiment spec, in tsv format.

optional arguments:
-h, --help show this help message and exit
-m MODEL, --model MODEL
Optional: model filename, .g or .xml
-d DUMP_SUBSET, --dump_subset DUMP_SUBSET
Optional: dump selected subset of model into named
file
-p PARAM_FILE, --param_file PARAM_FILE
Optional: Generate file of tweakable params belonging
to selected subset of model
-t, --tabulate_output
Flag: Print table of plot values. Default is NOT to
print table
-hp, --hide_plot Hide plot output of simulation along with expected
values. Default is to show plot.
-hs, --hide_subplots Hide subplot output of simulation. By default the
graphs include dotted lines to indicate individual
quantities (e.g., states of a molecule) that are being
summed to give a total response. This flag turns off
just those dotted lines, while leaving the main plot
intact.
-o, --optimize_elec Optimize electrical computation. By default the
electrical computation runs for the entire duration of
the simulation. With this flag the system turns off
the electrical engine except during the times when
electrical stimuli are being given. This can be *much*
faster.
-s SCALE_PARAM SCALE_PARAM SCALE_PARAM, --scale_param SCALE_PARAM SCALE_PARAM SCALE_PARAM
Scale specified object.field by ratio.
-settle_time SETTLE_TIME, --settle_time SETTLE_TIME
Run model for specified settle time and return dict of
{path,conc}.

```

Command `findsim_parellel` is a helper utility: it runs multiple simulations
using `findsim` in parellel.

# Install
To run FindSim script one needs to
- Install MOOSE which can be found here
https://moose.ncbs.res.in/readthedocs/install/install.html
- Install FindSim:
Clone the entire repository using
>git clone https://github.com/BhallaLab/FindSim
or, clone specific branch such as "stable" using:
>git clone -b <branch-name> https://github.com/BhallaLab/FindSim

=============================================================================
# File organization:
FindSim/ : project directory
FindSim/stable : Stable branch. Stable version of `develop` branch
FindSim/Curated : Folder contains FindSim worksheets to which the model is well fit.
FindSim/models : Model files
FindSim/findSim.py : Main findSim script
FindSim/runAllParallel.py : Batch/parallel wrapper script.
FindSim/FindSim-Exptworksheet.xlsx : Template worksheet with inline help and units, for Microsoft Excel.
FindSim/FindSim-Exptworksheet.ods : Template worksheet with inline help and units, for Libre Office.
FindSim/FindSim-Schema.xml : Schema for tsv files for worksheet.
FindSim/README.md : This file

=============================================================================
# Quick start:
A. Run one of the example experiments on the default model, generating a graph to compare model to experiment:
To run the script, run the command in python and `synSynth7.g` is the latest model that is tested out the worksheets.
>python findSim.py Curated/FindSim-Jain2009-Fig2B.tsv --model synSynth7.g
or
>python findSim.py Curated/FindSim-Jain2009-Fig2B.tsv

B. Batch run:
-runAllParallel.py script runs the findSim program on all tsv files in the specified directory, computes their scores, and prints out basic stats of the scores. It can do this in parallel using Python's multiprocessing library.
# Quick start

To run one of the example experiments on the default model (`synSynth7.g`) and generate a graph
to compare model to experiment.

```
findsim Curated/FindSim-Jain2009-Fig2B.tsv
```

You can also pass the model explicitly,

```
findsim Curated/FindSim-Jain2009-Fig2B.tsv --model models/synSynth7.g
```


## Batch run

To findSim program on all tsv files in the specified directory, computes their
scores, and prints out basic stats of the scores, you should use
`findsim_parallel` command.

>python runAllParallel.py Curated -n 8 (run of the entire set of `Curated` experiments on 8 cores)
or
>python runAllParallel.py Directory (of tsv files) -n (Number of processes to spawn) --model (synSynth7.g)
```
findsim_parellel Curated -n 8
```

It will run the entire set of `Curated` experiments in parallel using 8
independant processes (it will be effectively if your computer has at least 8
cores). The value of `-n` should not be more than `N+1` where `N` is the number
of processors on your system (use system utility `nproc` to see this number).

C. Syntax help:
>python findSim.py -h
>python runAllParallel.py -h
More detailed invocation of this command looks like the following:

```
findsim_parallel path/to/tsv/files -n 6 --model synSynth7.g
```

=============================================================================
# Repository organization

Generating Figures for
"FindSim: a Framework for Integrating Neuronal Data and Signaling Models."
by
Nisha A. Viswan, G.V. HarshaRani, Melanie I. Stefan, Upinder S. Bhalla
Front Neuroinform. 2018 Jun 26;12:38. doi: 10.3389/fninf.2018.00038. eCollection 2018.
FindSim/ : project directory
FindSim/stable : Stable branch. Stable version of `develop` branch
FindSim/Curated : Folder contains FindSim worksheets to which the model is well fit.
FindSim/models : Model files
FindSim/findSim.py : Main findSim script
FindSim/runAllParallel.py : Batch/parallel wrapper script.
FindSim/FindSim-Exptworksheet.xlsx : Template worksheet with inline help and units, for Microsoft Excel.
FindSim/FindSim-Exptworksheet.ods : Template worksheet with inline help and units, for Libre Office.
FindSim/FindSim-Schema.xml : Schema for tsv files for worksheet.
FindSim/README.md : This file

All these are run using the development branch "stable"
Please change into the branch to run these.
# Extra

Generating Figures for __FindSim: a Framework for Integrating Neuronal Data
and Signaling Models by Nisha A. Viswan, G.V. HarshaRani, Melanie I. Stefan,
Upinder S. Bhalla Front Neuroinform. 2018 Jun 26;12:38. doi:
10.3389/fninf.2018.00038. eCollection 2018.__

All these are run using the branch `release.1.1.0`. Please change into the
branch to run these.

Figure 6: bottom
python findSim.py Curated/FindSim-Jain2009_Fig4F.tsv --model models/synSynth7.g
python findSim.py Curated/FindSim-Jain2009_Fig4F.tsv --model models/synSynth7.g

Figure 7B:
python findSim.py Curated/FindSim-Bhalla1999_fig2B.tsv --model models/synSynth7.g
python findSim.py Curated/FindSim-Gu2004_Fig3.tsv --model models/synSynth7.g
python findSim.py Curated/FindSim-Bhalla1999_fig2B.tsv --model models/synSynth7.g
python findSim.py Curated/FindSim-Gu2004_Fig3.tsv --model models/synSynth7.g

Figure 7C:
python findSim.py Curated/FindSim-Ji2010_fig1C_ERK_acute.tsv --model models/synSynth7.g
python findSim.py Curated/FindSim-Ji2010_fig1C_ERK_acute.tsv --model models/synSynth7.g

Figure 7D:
python findSim.py Curated/FindSim-Bhalla1999_fig4C.tsv --model models/synSynth7.g
python findSim.py Curated/FindSim-Bhalla1999_fig4C.tsv --model models/synSynth7.g


=============================================================================
# Other resources
Project is hosted at https://github.com/BhallaLab/FindSim

The web template for experiment worksheet can be found here https://www.ncbs.res.in/faculty/bhalla-findsim/worksheet
- The web template for experiment worksheet can be found here
https://www.ncbs.res.in/faculty/bhalla-findsim/worksheet

- The MOOSE site: http://moose.ncbs.res.in. MOOSE documentation:
http://moose.ncbs.res.in/readthedocs/install/index_install.html

The MOOSE site: http://moose.ncbs.res.in
- Two papers were used as the initial basis for the models, and which in turn
refer to a large number of experimental studies for their data:

MOOSE documentation: http://moose.ncbs.res.in/readthedocs/install/index_install.html
1. Bhalla US., Iyengar R. Emergent properties of networks of biological signaling pathways. Science. 1999 Jan 15;283(5400):381-7.
2. Jain P, and Bhalla, U.S. Signaling logic of activity-triggered dendritic protein synthesis: an mTOR gate but not a feedback switch. PLoS Comput Biol. 2009 Feb;5(2):e1000287. Epub 2009 Feb 13

Two papers were used as the initial basis for the models, and which in turn
refer to a large number of experimental studies for their data:
- Bhalla US., Iyengar R. Emergent properties of networks of biological signaling pathways. Science. 1999 Jan 15;283(5400):381-7.
- Jain P, and Bhalla, U.S. Signaling logic of activity-triggered dendritic protein synthesis: an mTOR gate but not a feedback switch. PLoS Comput Biol. 2009 Feb;5(2):e1000287. Epub 2009 Feb 13
- Two more papers were used for some of the experiments

Two further papers were used for some of the experiments:
- Gu J, et al. Beta1,4-N-Acetylglucosaminyltransferase III down-regulates neurite outgrowth induced by costimulation of epidermal growth factor and integrins through the Ras/ERK signaling pathway in PC12 cells. Glycobiology. 2004 Feb;14(2):177-86. Epub 2003 Oct 23
- Ji Y, et al. Acute and gradual increases in BDNF concentration elicit distinct signaling and functions in neurons. Nat Neurosci. 2010 Mar;13(3):302-9. doi: 10.1038/nn.2505. Epub 2010 Feb 21.
1. Gu J, et al. Beta1,4-N-Acetylglucosaminyltransferase III down-regulates
neurite outgrowth induced by costimulation of epidermal growth factor and
integrins through the Ras/ERK signaling pathway in PC12 cells.
Glycobiology. 2004 Feb;14(2):177-86. Epub 2003 Oct 23
2. Ji Y, et al. Acute and gradual increases in BDNF concentration elicit
distinct signaling and functions in neurons. Nat Neurosci. 2010
Mar;13(3):302-9. doi: 10.1038/nn.2505. Epub 2010 Feb 21.

DOQCS database, from which models were derived: http://doqcs.ncbs.res.in
Sivakumaran S. et al. The Database of Quantitative Cellular Signaling: management and analysis of chemical kinetic models of signaling networks.
Bioinformatics. 2003. 19(3):408–415
- DOQCS database, from which models were derived: http://doqcs.ncbs.res.in
__Sivakumaran S. et al. The Database of Quantitative Cellular Signaling:
management and analysis of chemical kinetic models of signaling networks.
Bioinformatics. 2003. 19(3):408–415__
80 changes: 80 additions & 0 deletions TestTSV/fepsp.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
Experiment metadata
transcriber Upi
organization NCBS
emailId [email protected]
exptSource None
citationId None
authors None
journal None. This is a purely fictional _experiment_ for the purposes of testing findSim


Experiment context
exptType TimeSeries
species rat
cell-types hippocampal CA1 pyramidal neuron
temperature (Celsius) 30
Include all
details
notes HFS, LTP

Stimuli
compartment dend
timeUnits sec
quantityUnits Hz
entities synInput
field rate
Data
Time Value
0 0
10 100
11 0

Stimuli
compartment dend
timeUnits sec
quantityUnits ratio
entities synapse
field weight
Data
Time Value
0 1
10 1
11 0.4


Readouts
timeUnits sec
quantityUnits mV
useXlog FALSE
useYlog FALSE
ratioReferenceTime 1
ratioReferenceEntity soma
entities soma
field fEPSP_peak
useNormalization False
Data
Time Value stderr
6 0.15 0
8 0.15 0
15 0.4 0
16 0.45 0
17 0.5 0
18 0.55 0
20 0.6 0

Model mapping
modelSource internal
fileName models/plastic8.py
citationId
citation
authors
modelSubset all
modelLookup soma:elec/soma,synInput:elec/head0/glu/sh/synapse/synInput,synapse:elec/head0/glu/sh/synapse
scoringFormula abs((expt-sim)/(datarange+1e-9))
solver none
notes
# Monitor response with a low stimulus amplitude/weight with initial
# test pulses 4 and 8 sec. Then give a 100Hz synaptic input at t = 10-11s.
# Then monitor response at 15, 20 s.


Empty file added __init__.py
Empty file.
23 changes: 23 additions & 0 deletions __main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""__main__.py:

Entry point for this package.
"""

__author__ = "Dilawar Singh"
__copyright__ = "Copyright 2017-, Dilawar Singh"
__version__ = "1.0.0"
__maintainer__ = "Dilawar Singh"
__email__ = "[email protected]"
__status__ = "Development"


def run():
from FindSim import findSim
findSim.main()

def run_parallel():
from FindSim import runAllParallel
runAllParallel.main()

if __name__ == '__main__':
run()
Loading