Skip to content
The BioScript compiler, ChemStor storage, and Application Binder.
Python TSQL
Branch: master
Clone or download

Latest commit

tlove004 refactor (#78)
* Getting started on the testing hooks for mfsim targeting.

Basic tests for SISD instructions all passing.
TODO:  add tests for all benchmark assays and verify correctness is correct, exposes some edge cases that need to be dealt with.

* Getting started on the testing hooks for mfsim targeting.

Basic tests for SISD instructions all passing.
TODO:  add tests for all benchmark assays and verify correctness is correct, exposes some edge cases that need to be dealt with.

* -- cli argument for volume tracking added, defaulted to OFF
-- issue discovered in volume tracking where a phi has a use before def (shows up in loops) -- test added to suite which fails to highlight
-- refactored deprecated use of log.warn->log.warning
-- full test suite for MFSim target added
Latest commit c4e5cec Feb 17, 2020


Type Name Latest commit message Commit time
Failed to load latest commit information.
chemicals typing appears to be working again. Nov 19, 2019
compiler refactor (#78) Feb 17, 2020
grammar @ 25b3b53 Fixed type error Jan 7, 2020
mix added files for storage and mix. Mar 5, 2019
resources refactor (#78) Feb 17, 2020
shared math is done, methods are almost done. Now onto conditionals. Aug 3, 2019
storage updated readme. Nov 30, 2019
tests refactor (#78) Feb 17, 2020
.gitignore Merge branch 'master' into tyson/mfsim_trans Oct 7, 2019
.gitmodules added a submodule Jul 24, 2018
CODEOWNERS Create CODEOWNERS Jan 7, 2020 Merge pull request #62 from lilott8/hotfixes Oct 23, 2019 Added init files Dec 24, 2019 Merge branch 'master' into asiga001track_volume Jan 23, 2020
requirements.txt Updated readme and requirements. Oct 23, 2019 put in its place. Nov 23, 2019


A simple type-safe Domain Specific Language (DSL) for chemistry and biology.


usage: [-h] -i INPUT [-d] [-wd WORKING_DIRECTORY] [-o OUTPUT]
       [-t {m,i,p,inkwell,l,llvm,ir,mfsim,puddle}] [-cfg] [-inline]
       [-stats] [-lu] [-sim {False,True}] [-id {0,1,2,32,4,8,16}]
       [-nf] [-smarts SMARTS] [-tcl {none,warn,error}] [-tc]
       [-tcu {complex,simple,s,c}] [-epa EPA_DEFS] [-abs ABS_INT]
       [--dbname DBNAME] [--dbuser DBUSER] [--dbpass DBPASS]
       [--dbaddr DBADDR] [--dbdriver {odbc,mysql}] [-lib LIBRARY]
       [-flow {passive,p,a,active}] [--cdb CDB] [--schema SCHEMA]

Optional Arguments:

Short Long Flag Purpose
-h --help show this help message and exit
-i --input path/to/ Location of input file
-d --debug Enable debugging.
-t --target {i,inkwell,p,puddle,m,mfsim,l,llvm, ir,} What platform do you wish to target?
-o --output path/to/output/dir Enable writing output. Must be set to write anything
-wd --working-directory path/to/directory Directory from where you wish to work
-cfg --write-cfg Write the CFG to a dot file
-inline --inline Inline all non-recursive functions
-lu --loopunroll Unroll all un-rollable loops
-stats --stats Print the stats to std out
-cfg --write-cfg Write the programs control flow graph to disk


Chemistry specific arguments

Short Long Flag Purpose
-sim --simulate {True, False} Simulate chemistry?
-id --identify {0,1,2,32,4,8,16} Chemical identification level
-nf --no-filters Disable smart filter creation
-smarts --smarts 0-255 Length of smarts file to use


Typing specific arguments

Short Long Flag Purpose
-tcl --typechecklevel {error, warn, none} What interactions elicit notifications
-tc --typecheck Enable type checking of input program
-tcu --typesused {s, simple, c, complex} What types to use to typecheck a program, s = {mat, nat, real}, c = {all types in chemtype}
-epa --epa-defs Path/to/epa_defs.json Location of the EPA definition file (default: ./resources/epa.json)
-abs --abs-int path/to/abs-int.txt Location of the abstract interaction file (default: ./resources/abstract-interaction.txt)


Database specific arguments

Flag Argument Purpose
--dbname str Name of database.
--dbuser str Database user.
--dbpass str Database password for user.
--dbaddr {IP, Host} Address of database.
--dbdriver {mysql,odbc} Database driver.


Inkwell specific (-t inkwell) flags

Short Long Flag Purpose
-lib --library path/to/json/component/lib The path to the component library
-flow --flow {p, a, passive, active} Which type of flow-based device are you targeting
-cdb database Name of component database (not supported)
--schema Path to schema.json The ParchMint schema file
--validate Validate a netlist against the ParchMint schema


You'll need Python3 (apt-get install python3), and GraphViz installed (apt-get install graphviz)

If on macOS, install brew, then brew install python3 and brew install graphviz.

BioScript's grammar is attached as a submodule. Hence, if cloning this repo, make sure to include the --recursive tag:

git clone --recursive

Also, if BioScriptGrammar (or any other submodule) is updated, you'll need to run git submodule foreach git pull origin master if your version of git does not do this automatically for you.

Install required python modules: pip install -r requirements.txt

Try running the example usage (below). It's possible that a C-style comment /* ... */ is present in some of the grammar files generated by Antlr. Open any offending files and use proper pythong comments # to mitigate this issue.

Some modules may have not installed properly even using the recursive pip install method above.

Continue trying the example usage (below), and pip install any missing modules.

Note: you may need to use pip3 install if python3/pip3 is not your default python/pip alias.

Example Usages:

Enable debug (-d), compile a file (-i ...), target BioScript's IR (-t ...), and place the output files in the specified location:

python -d -i tests/test_cases/mix/ -t ir -o ./output -cfg

Your output folder should includ the following files:,,

You can either use graphviz to create a .png of the generated dag (dot -Tpng -o dag.png), or use and paste the contents of the .dot or .dag file for visualization.

You can’t perform that action at this time.