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

Membrane components, mechanism, and examples #285

Closed
wants to merge 188 commits into from

Conversation

zjuradoq
Copy link

This pull request contains membrane components, mechanisms, and a specialized example for each type. Additionally, the component was updated to have a compartment attribute. Unit tests for each new component and mechanism have also been included. This pull request supersedes previous pull requests which aimed to add membrane components.

zjuradoq and others added 30 commits November 21, 2024 13:20
Updating from head repository
This PR just updates the versioning and some Repo files like the Readme.
* Hill propensities now save the right parameters as SBML

* Added Tests

* Changed the format of hill functions to match bioscrape

* rate spacing

Co-authored-by: William Poole <[email protected]>
The propensity format for both the rate formula and the pretty_print text has been fixed to match in all propensity cases.

The Building CRNs Direclty example notebook has also been fixed to reflect these changes.

Tests have been corrected to reflect these changes.

Co-authored-by: William Poole <[email protected]>
…uildACell#204)

* Combinatorial CRN validation via Component_CRN_validation function

This function looks at Components based on their type and ensures that the CRN has reactions with reasonable input and output species. Used in combinatorial testing to ensure that not only do all core Components compile but they produce reasonable CRNs.

* added keywords to test

Co-authored-by: William Poole <[email protected]>
* Linear DNA degredation inhibited by gamS Example

* "protease" renamed "degredase"

* Moved matplotlib inline to fix test cases

* None check in jupyter notebook

Co-authored-by: William Poole <[email protected]>
…BuildACell#208)

* refactor initial_concentration dictionary to support Species type

CRN simulators need an initial_concentration dictionary which has a pair of Species and numeric values.
So far user had to provide a string representation of a Species. Now Species type is also allowed.

* refactor initial_concentration dictionary to support Species type

CRN simulators need an initial_concentration dictionary which has a pair of Species and numeric values.
So far user had to provide a string representation of a Species. Now Species type is also allowed.
* refactor roadrunner interface

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.

* refactor function name: simulate_with_roadrunner to keep it consistent with bioscraper
* unit test adjust to dectect both cases: libroadrunner is installed or not and
* an example Jupyter notebook is added

* refacor test_simulation_packages_import.py for better readability
* Replace initial_conc to initial_concentrations (BuildACell#207)

* replace initial_conc to initial_concentrations

* replace concentrationentration with concentration

* started making tests

* Initial Conditions now come from the ParameterDatabase

initial_concentration can still be passed into a Component, the value is just inserted into its database.

* unit tests all run

*species no longer have an initial concenration
*ChemicalReactionNetwork has an initial_condition_dict property with setter etc
*sbml writing was updated to use an initial concentration dict.
*Component.get_parameter updated to work with initial conditions (so it can be called by the Mixture without erroring)
*Initial_concentration is now a Component property synced with the Component's ParameterDatabase via the setter

* All notebooks now run correctly

* DNApart returns error if given initial_concentration keyword

Also added a couple extra tests to DNApart

* pretty_print updated to deal with new initial conditions

* initial condition unit tests

* compile time tests

* PR issues fix

* initial_condition renamed initial_concentration

* Removed initial_concentration setting from some Mixtures

* bug fixes

Co-authored-by: Ayush Pandey <[email protected]>
Co-authored-by: William Poole <[email protected]>
This commit adds EnergyTxTlExtract with limited fuel resources. 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.

* New Mechanisms, Component, and Mixture created
* All notebooks now run correctly
* unit tests all run
* Example notebook created with parameters from the simulation in Singhal et al. 2020 OUP SynBio
* improved parameter file
* Moved imports into try statement in example notebook

Co-authored-by: William Poole <[email protected]>
Co-authored-by: Ayush Pandey <[email protected]>
MultiEnzyme and Enzyme classes are merged because they had the same functionality. The signature of Enzyme has changed to substrates (plural) and products (plural), but it accepts a single string, Species or Component not just lists of those. Example notebooks are adjusted to the new signature.
Unit tests are implemented for the refactored Enzyme class.

Closes BuildACell#148

Signed-off-by: zoltuz <[email protected]>
Promoter and RBS initialization logic was exposed to the DNAassembly. This has been moved inside the respective classes, and from_promoter() and from_rbs() are introduced to handle the different cases.
New Unittests are included. No example was modified

closes BuildACell#150

Signed-off-by: zoltuz <[email protected]>
)

* CRN Species and Reactions are "immutable" and test cases

* Removed notebook from different PR

Co-authored-by: William Poole <[email protected]>
* first cut at species new instance attribute called compartment

* modify pretty print with compartment defaulted to False, add basic compartment tests

* set default compartment name for all species that don't have any

* add compartment instance attribute to orderedpolymer, and other similar classes

* rename species_sbml_id to valid_sbml_id. Add Compartment class to create generalized SBML compartments. Add all compartments to CRN SBML

* add compartments to SBML before adding species or reactions

* add compartment equality check

* add membrane model example. Bunch of tests for new compartment adding to SBML

* merge upstream dev

* add _compartment_name to species __repr__

* add compartment to pretty print

* merge conflict bug fix

* merge conflict bug fix2

* simplified speices id lookup in sbmlutil. membrane model ipynb works

* autopep8 for test_sbml and species.py to fix pep8 related minor issues

* add compartment to pretty print species used in plotting.py

* fix species pretty print bug for compartment

* modify compartment tests for coverage

* add one more compartment test

* test compartment bug fix

* add license information to compartments.py

* add more tests and use unittest with tests built using unittest

* fix test bugs

* more test fixes for coverage

* add one more species.py test

* remove redundant code check in Complex

* add compartment unit attribute. Rename compartment volume to size

* remove intiial_concentration from species.py
This PR adds units compatibility for BioCRNpyler (addressing BuildACell#130 ).  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.]

* Parameter units loaded from files and constructors with appropriate tests
* units working, 5. Parameter notebook has the example SBML using the perfect parameter csv
* add tests for units and unit list checks
* fix warning pytest check
* add a dictionary of supported units

Co-authored-by: William Poole <[email protected]>
Co-authored-by: William Poole <[email protected]>
Co-authored-by: Eldad Afik <[email protected]>
Co-authored-by: Zoltan Tuza <[email protected]>
Co-authored-by: dr3y <[email protected]>
William Poole and others added 26 commits November 27, 2024 10:58
…ll#260)

* correctly compare parts at correct position during omnihash

* tiny docstring added
Updates for transport mechanism and membrane components. Includes example notebook.
Fetch from the origin
Update based on master
The addition of all membrane components,  transport mechanism, associated unit tests, and an example.
Correcting SyntaxError: non-default argument follows default argument
Additional bugs found when testing the code.
@zjuradoq zjuradoq requested a review from ayush9pandey January 16, 2025 22:54
plotting.py was not up to date to master
@zjuradoq
Copy link
Author

I am closing this pull request as it was not current with the master branch. An updated branch has been created, and a new pull request containing the same information has been made.

@zjuradoq zjuradoq closed this Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants