Skip to content

Commit

Permalink
Dev to Master Version 1.1.0 (#249)
Browse files Browse the repository at this point in the history
New Features:
* libroadrunner integration: this new interface allows to simulate CRNs with roadrunner (libroadrunner). Two main operation mode (determined by return_roadrunner flag): getting back numerical results or getting back the roadrunner model object for further analysis.
* Initial Concentrations: now come from the ParameterDatabase (parameter_name "initial concentration", component [species_name]). Can also be set from a dictionary {species:value}. Initial conditions printed in pretty_print function
* EnergyExtract Mixture: this new Extract makes use of a new Component, Metabolite, and new Mechanisms including OneStepPathway in mechanisms_metabolic.py and Energy_Transcription_MM and Energy_translation_MM. These are collectively used to recreate the Model from Singhal et al. 2020 OUP SynBio with a few minor modifications to avoid time-dependent rates and simplify some of the species. These results are detailed in a new jupyter notebook in the advanced examples folder along with a parameter file that includes rates from Singhal et al. 2020 OUP SynBio. Issue #210
* Compartments feature allows Species to be given a compartment attribute  (#211)
* Units compatibility for BioCRNpyler (addressing #130 and #219).  Summary of how it works: units.py has a list of functions that create unit definitions (as required by SBML). These functions are factored in a way that new functions can be easily added with no changes required at any other place in the codebase. So, to add new units, the user simply adds their units to their parameter file in a new column, adds a function corresponding to that unit id string in units.py (this is a simple 3 line function that can be created by copying one of the existing function for units). Parameter class has a new attribute "unit" that goes with every Parameter object (we can discuss what's the best way to do this). This is the part that is incomplete and I need some help so that we can get this done quickly. The tsv file Perfect Parameter File has a new column "units", we will use this to test the functionality to make sure units are correctly read and written to SBML.
So, the current to-do is a minor one: successfully read the Perfect Parameter file with units so that all parameters that have been read have a param.unit attribute.]
* Component Enumeration allows for Components to be generated during the first stage of compilation. IntegrasesConstructs and DNAConstructs are example Components that use enumerators.
* Integrase enumerator (#221) is a set of powerful features that allow integrase-based DNA recombinations to be enumerated and compiled. See the Integrase notebooks for examples.
* Plotting upgrades include coloring features and mouse-over pop-up illustrations of network plots. See plotting examples, integrase examples, and DNA_construct examples.

Larger Changes:
* CRNlab.py has been deleted
* Old Reaction Interface has been removed
* Sphynx issues resolved for automatic documentation generation
* CRN Species and Reactions are "immutable" meaning that they cannot be changed once they are part of a CRN. + Test cases (#214)
* Created MonomerCollection class. OrderedPolymer.polyer is a property: This is a superclass of OrderedPolymer and is the more parent class for OrderedMonomers. PolymerConformations are an example of MonomerCollections.

Name Changes:
* "protease" renamed "degredase"
* Enzyme and MultiEnzyme merged to just be Enzyme(products = ..., substrates = ...) (#212)
* Replace initial_conc to initial_concentrations (#207) & (#209)
* Removed Multimer (this must have been reinserted in a previous PR) and removed Nmer from binding mechanisms

Small Changes and bug fixes:
* OrderedPolymerSpecies.from_polymer_species class method: This is used by Complex to produce new OrderedPolymerSpecies.
* fixed polymer.insert and polymer.remove
* Species equality changed to look at parent instances: This is needed to stop recursion in equalities between nested Complexes inside of PolymerConformations
* Complex funciton expanded, tested and simplified
* remove_bindloc now recursive for PolymerConformations
* added Mechanisms tests
* Dev readme species (#224)
* Compilation Directives for faster CRN compilation USE AT YOUR OWN RISK
* Fix for SBML kinetic law formula #225 (#231)
* remove old code in chemical_reaction_network.py. fix sbml_warnings keyword in simulate function
* linter check as part of github automations
* To speed up the CRN generation SBML ids are pre-generated. Also, the CRN validity check can be switch off by the user.(#239)

Co-authored-by: Ayush Pandey <[email protected]>
Co-authored-by: William Poole <[email protected]>
Co-authored-by: Zoltan Tuza <[email protected]>
Co-authored-by: Eldad Afik <[email protected]>
Co-authored-by: dr3y <[email protected]>
Co-authored-by: Benedict Carling <[email protected]>
  • Loading branch information
7 people authored Jun 18, 2021
1 parent 02318ad commit 11b77cf
Show file tree
Hide file tree
Showing 102 changed files with 9,282 additions and 4,498 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/process_linter_results
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Process linter results

# read-write repo token
# access to secrets
on:
workflow_run:
workflows: ["Linter"]
types:
- completed

jobs:
upload:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' }}
steps:
- name: 'Download artifact'
uses: actions/[email protected]
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "linter_output"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/linter_output.zip', Buffer.from(download.data));
- run: unzip linter_output.zip
- name: Set up Python
uses: actions/setup-python@v2
# pinned to lintly 0.5.0 due to https://github.com/grantmcconnaughey/Lintly/issues/41
- name: Install dependencies
run: pip install lintly==0.5.0
- name: 'Comment on PR'
run: |
cat ./flake8.out | lintly --use-checks \
--fail-on new \
--pr="$(cat ./pr_number)" \
--exit-zero \
--no-request-changes \
--no-post-status \
--commit-sha="$(cat ./head_sha)"
env:
LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Tests/sbml_test_file.xml


# Sphinx documentation
docs/_build/
docs/build/

# Covers JetBrains PyCharm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# !!!make sure you use TABs instead of 4 spaces once you edit this file!!!
#

.PHONY: docs
# test the core functionality of the toolbox
test :
python setup.py test
Expand All @@ -25,3 +25,7 @@ get_test_deps :
pip install codecov
pip install flake8-mutable
pip install flake8

docs :
# this has to be one line to run everything in the docs folder
cd docs; echo "Running Sphinx docs generator"; sphinx-apidoc -o source/ ../biocrnpyler; python generate_nblinks.py; make clean && make html;
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
[![PyPI version](https://badge.fury.io/py/biocrnpyler.svg)](https://badge.fury.io/py/biocrnpyler)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/BuildACell/BioCRNPyler/master?filepath=%2Fexamples%2F)


BioCRNPyler (pronounced Bio-Compiler) is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex biochemical networks.
BioCRNPyler (pronounced Bio-Compiler) is a Python package for the creation, manipulation,
and study of the structure, dynamics, and functions
of complex biochemical networks.

- **Website:** http://buildacell.io/BioCRNPyler
- **Mailing list:** [SBTools Google Group](https://groups.google.com/g/sbtools/) Email: [email protected]
- **Source:** https://github.com/BuildACell/BioCRNPyler
- **Paper:** - [BioCRNpyler: Compiling Chemical Reaction Networks from Biomolecular Parts in Diverse Contexts](https://www.biorxiv.org/content/10.1101/2020.08.02.233478v1)
- **Mailing list:** [SBTools Google Group](https://groups.google.com/g/sbtools/) Email: [email protected]
- **Bug reports:** https://github.com/BuildACell/BioCRNPyler/issues
- **Documentation:** Coming Soon!
- **Video Tutorials:** [Introduction to CRN Modeling](https://www.youtube.com/watch?v=mu-9MSntd2w&list=PLb2LmjoxZO-g2vbTr3HBcnvVZur8JFiqf&index=1&t=1164s), [CRNs with BioCRNpyler Tutorial](https://www.youtube.com/watch?v=l1uVqwZwxX0&list=PLb2LmjoxZO-g2vbTr3HBcnvVZur8JFiqf&index=2), [BioCRNpyler Compilation Overview](https://www.youtube.com/watch?v=lw3DbBnsPgs&list=PLb2LmjoxZO-g2vbTr3HBcnvVZur8JFiqf&index=3), and [BioCRNpyler Compilation Tutorial](https://www.youtube.com/watch?v=eLjxCStLvsQ&list=PLb2LmjoxZO-g2vbTr3HBcnvVZur8JFiqf&index=4).
- **Slack:** Join the #biocrnpyler channel on SBTools slack: Ask on the public SBTools Google group to be added or send a message to one of the maintainers.
- **Documentation** https://github.com/BuildACell/BioCRNPyler/
- **Slack** Join the #biocrnpyler channel on SBTools slack: Ask on the public SBTools Google group to be added or send a message to one of the maintainers.

# Example 1: Building Simple CRNs by Hand

Expand All @@ -26,7 +27,7 @@ BioCRNpyler allows for CRNs to be built by hand, adding Species and Reactions ma
from biocrnpyler import *
# let's build the following CRN
# A -->[k1] 2B
# B -->[k2] B+D
# B -->[k2] C+D
# Species
A = Species("A")
B = Species("B")
Expand All @@ -37,7 +38,7 @@ D = Species("D")
k1 = 3.
k2 = 1.4

#Reaciton Objects
#Reaction Objects
R1 = Reaction.from_massaction([A], [B, B], k_forward = k1)
R2 = Reaction.from_massaction([B], [C, D], k_forward = k2)

Expand Down
Loading

0 comments on commit 11b77cf

Please sign in to comment.