Team:Newcastle/Modeling/Population/Pseudo
From 2009.igem.org
(→Population modelling pseudo code) |
TubularWorld (Talk | contribs) |
||
(11 intermediate revisions not shown) | |||
Line 2: | Line 2: | ||
{{:Team:Newcastle/Header}} | {{:Team:Newcastle/Header}} | ||
{{:Team:Newcastle/Left}} | {{:Team:Newcastle/Left}} | ||
- | + | = Population modelling overview= | |
- | This page provides an overview of the code which the Newcastle team has developed for | + | This page provides an overview of the [[:Image:Newcastle Distributed Microbase Population src.zip|code]] which the Newcastle team has developed for their population simulation model. |
- | + | == Bacterial simulation overview == | |
[[Image:Newcastle Java Coding Example.png|thumb|An example of the Java programming in this project, showing the Subtilis.java class file.]] | [[Image:Newcastle Java Coding Example.png|thumb|An example of the Java programming in this project, showing the Subtilis.java class file.]] | ||
- | For the actual simulation of the bacterial life cycles, we decided to allow each bacterial cell to run as a separate thread. The phenotype of a bacterial cell changes depending on what state they are in, so we decided to have a number of different classes to represent these states. These classes have some common attributes, which can be represented as a superclass in object orientated computing. | + | === Bacterial cells classes === |
+ | : ''See [[Team:Newcastle/Modeling/Population/Pseudo/Bacteria Code|Bacteria Pseudo Code]]''. | ||
+ | For the actual simulation of the bacterial life cycles, we decided to allow each bacterial cell to run as a separate thread. The phenotype of a bacterial cell changes depending on what state they are in, so we decided to have a number of different classes to represent these states. These classes have some common attributes, which can be represented as a superclass in object orientated computing. There is also an additional simple class for easily storing spacial coordinates, ie 3 number values. | ||
+ | [[Image:Newcastle 3d max 5.png|right|160px]] | ||
Superclass: | Superclass: | ||
* Cell - contains the common attributes, such as levels of cadmium and nutrients. The Cell class also provides access to the database. | * Cell - contains the common attributes, such as levels of cadmium and nutrients. The Cell class also provides access to the database. | ||
Subclasses: | Subclasses: | ||
- | * Subtilis - represents vegetative cells. From here cells can make various life choices and enter other states accordingly. | + | * Subtilis - represents vegetative cells. From here cells can make various life choices and enter other states accordingly. These can become Spores, Biofilm, Motile, and divide into two. |
* Spore - represents the spore stage of the life cycle. Note that in our project the cells have to choose whether they are going to become a "metal sequestering" spore which cannot germinate. | * Spore - represents the spore stage of the life cycle. Note that in our project the cells have to choose whether they are going to become a "metal sequestering" spore which cannot germinate. | ||
* Biofilm - represents the biofilm phenotype of the cells. | * Biofilm - represents the biofilm phenotype of the cells. | ||
* Motile - represents motility of the cells | * Motile - represents motility of the cells | ||
+ | |||
+ | === Bio-chemical model integration === | ||
+ | To split off the code that connects to the JSim application, which runs bio-chemical models, such as the ones that we have written in CellML, we put this code into it's own class, ModelSims. Currently this just uses the Sin Operon Model for influencing sporulation, but this can be easily expanded to cover other aspects of our project which have been modelled, such as metal intake. | ||
+ | |||
+ | This code calls a command line application, jsbatch, with parameters from the bacterial agent cell, parses the JSim output and returns a value which is used by the cell to make decisions. This code is run for each cell thread when it wants to run the appropriate model for the decision that it is currently making. | ||
+ | |||
+ | === Database classes === | ||
+ | [[Image:Newcastle Amazon.png|thumb|The way in which the cell threads, the database and Microbase interact.]] | ||
+ | There are a number of classes which deal with communicating with the central database, which stores all of the data about each run of the simulation cell and each cell in that simulation. | ||
+ | * DAO - a data access object that provides an interface to the database. | ||
+ | * PopulationDAO - communicates with the table that records data about the current simulation run. This includes all of the parameters such as chances of state changes such as sporulation and germination, various rates of import/export, environment size, etc. | ||
+ | * BugLog - communicates with the table that records data about all the bacterial cells throughout all of it's life, recording every state change. | ||
+ | * Bug - communicates with the table that records only the most recent data about all the bacterial cells in each run of the simulation. This includes what state it is in at the moment (eg spore), how much cadmium is contained within, if it can germinate, etc. | ||
+ | * PendingBug - communicates with the table that records data about bugs that have been created as daughter cells. This is a class which Microbase uses to manage the running of bacterial cells or 'tasks' on many machines. | ||
+ | |||
+ | === Microbase classes === | ||
+ | Classes written to interface with Microbase include the Responder Implementation. This class manages how the population simulation is run across a distributed system by Microbase. | ||
== Appendix == | == Appendix == | ||
- | ;Computing Definitions | + | ; Computing Definitions |
Throughout this article some programming knowledge is assumed, but here are some selected definitions of terminology: | Throughout this article some programming knowledge is assumed, but here are some selected definitions of terminology: | ||
* ''Class'' - In object orientated programming, such as Java, it is a collection of computer code which is dedicated to one idea or entity. For example a student class may contain information about a student such as their name, date of birth, etc. | * ''Class'' - In object orientated programming, such as Java, it is a collection of computer code which is dedicated to one idea or entity. For example a student class may contain information about a student such as their name, date of birth, etc. | ||
- | * ''A Thread of Execution'' - Inside a computer program or process there may be two or more concurrently running tasks, these tasks, called | + | * ''A Thread of Execution'' - Inside a computer program or process there may be two or more concurrently running tasks, these tasks, called threads. These threads each compete for time on the computer processor and can communicate with shared objects. |
* ''Java'' - One of many object orientated programming languages. Java allows the same code to be run on lots of different types of machines (eg. Windows, Mac or Linux). | * ''Java'' - One of many object orientated programming languages. Java allows the same code to be run on lots of different types of machines (eg. Windows, Mac or Linux). | ||
+ | * ''Database'' - a collection of data managed by a computer, allowing data access and manipulation. | ||
+ | * ''Agent-based model'' - a computational model for simulating the actions and interactions of autonomous individuals with a view to assessing their effects on the system as a whole. | ||
+ | |||
{{:Team:Newcastle/Footer}} | {{:Team:Newcastle/Footer}} | ||
{{:Team:Newcastle/Right}} | {{:Team:Newcastle/Right}} |
Latest revision as of 03:01, 22 October 2009
Contents |
Population modelling overview
This page provides an overview of the code which the Newcastle team has developed for their population simulation model.
Bacterial simulation overview
Bacterial cells classes
- See Bacteria Pseudo Code.
For the actual simulation of the bacterial life cycles, we decided to allow each bacterial cell to run as a separate thread. The phenotype of a bacterial cell changes depending on what state they are in, so we decided to have a number of different classes to represent these states. These classes have some common attributes, which can be represented as a superclass in object orientated computing. There is also an additional simple class for easily storing spacial coordinates, ie 3 number values.
Superclass:
- Cell - contains the common attributes, such as levels of cadmium and nutrients. The Cell class also provides access to the database.
Subclasses:
- Subtilis - represents vegetative cells. From here cells can make various life choices and enter other states accordingly. These can become Spores, Biofilm, Motile, and divide into two.
- Spore - represents the spore stage of the life cycle. Note that in our project the cells have to choose whether they are going to become a "metal sequestering" spore which cannot germinate.
- Biofilm - represents the biofilm phenotype of the cells.
- Motile - represents motility of the cells
Bio-chemical model integration
To split off the code that connects to the JSim application, which runs bio-chemical models, such as the ones that we have written in CellML, we put this code into it's own class, ModelSims. Currently this just uses the Sin Operon Model for influencing sporulation, but this can be easily expanded to cover other aspects of our project which have been modelled, such as metal intake.
This code calls a command line application, jsbatch, with parameters from the bacterial agent cell, parses the JSim output and returns a value which is used by the cell to make decisions. This code is run for each cell thread when it wants to run the appropriate model for the decision that it is currently making.
Database classes
There are a number of classes which deal with communicating with the central database, which stores all of the data about each run of the simulation cell and each cell in that simulation.
- DAO - a data access object that provides an interface to the database.
- PopulationDAO - communicates with the table that records data about the current simulation run. This includes all of the parameters such as chances of state changes such as sporulation and germination, various rates of import/export, environment size, etc.
- BugLog - communicates with the table that records data about all the bacterial cells throughout all of it's life, recording every state change.
- Bug - communicates with the table that records only the most recent data about all the bacterial cells in each run of the simulation. This includes what state it is in at the moment (eg spore), how much cadmium is contained within, if it can germinate, etc.
- PendingBug - communicates with the table that records data about bugs that have been created as daughter cells. This is a class which Microbase uses to manage the running of bacterial cells or 'tasks' on many machines.
Microbase classes
Classes written to interface with Microbase include the Responder Implementation. This class manages how the population simulation is run across a distributed system by Microbase.
Appendix
- Computing Definitions
Throughout this article some programming knowledge is assumed, but here are some selected definitions of terminology:
- Class - In object orientated programming, such as Java, it is a collection of computer code which is dedicated to one idea or entity. For example a student class may contain information about a student such as their name, date of birth, etc.
- A Thread of Execution - Inside a computer program or process there may be two or more concurrently running tasks, these tasks, called threads. These threads each compete for time on the computer processor and can communicate with shared objects.
- Java - One of many object orientated programming languages. Java allows the same code to be run on lots of different types of machines (eg. Windows, Mac or Linux).
- Database - a collection of data managed by a computer, allowing data access and manipulation.
- Agent-based model - a computational model for simulating the actions and interactions of autonomous individuals with a view to assessing their effects on the system as a whole.
News
Events
- 20 – 21 June 2009 - Europe workshop (London)
- 23 – 24 June 2009 - UK iGEM meetup (Edinburgh)
- 23 October Practice Presentation (Newcastle)
- 23 October T-shirts are ready
- 27 October Practice Presentation (Sunderland)
- 27 October Poster is ready
- 30 October – 2 November 2009 - Jamboree (Boston)
Social Net
- Newcastle iGEM Twitter
- [http://www.facebook.com/home.php#/group.php?gid=131709337641 Newcastle on Facebook]
- [http://www.youtube.com/user/newcastle2009igem Newcastle Youtube Channel]