Team:BCCS-Bristol/Modelling/BSIM/GUI

From 2010.igem.org

(Difference between revisions)
(Interface Design)
(Interface Design)
Line 85: Line 85:
The final option in ths dialog is the camera angle. This has to be stated in the form {i,j,k}, where i,j and k are real, positive numbers. The camera angle is calculated using the ratio of these three numbers.
The final option in ths dialog is the camera angle. This has to be stated in the form {i,j,k}, where i,j and k are real, positive numbers. The camera angle is calculated using the ratio of these three numbers.
 +
 +
===Chemical Environment Options===
[[Image:GUI_Chemical_Environment.JPG|thumbnail|right|upright=3|Screenshot of GUI Chemical Environment options dialog]]
[[Image:GUI_Chemical_Environment.JPG|thumbnail|right|upright=3|Screenshot of GUI Chemical Environment options dialog]]

Revision as of 15:11, 11 October 2010

Contents

Graphical User Interface (GUI)

This page deals with the features and justification of the new BSim GUI. To download and install your free copy of BSim 2010 and the new BSim GUI, Please see the 'downloads' section. For instructions on how to operate the new GUI, see the 'tutorials' section.

Features

The new GUI supports many of the features of BSim 2009. These include:

  • Brownian Motion
  • Collisions
  • Chemical fields
    • Detection
    • Chemical emission and consumption
  • Colour signalling
  • Ordinary Differential Equations (ODEs)
  • Variable boundary conditions
  • Directed movement (Chemotaxis)

Development

Motivation

The 2009 edition of BSim was written using an object-oriented programming language called JAVA. This was an excellent tool in which to construct BSim, as it made it very easy to produce agent-based models. However, modelling a specific system in BSim required the user to edit JAVA code. We envision a future in which BSim is a widely used and accessible modelling framework. To achieve this we needed to create an interface that allows users unfamiliar with JAVA to create simulations in BSim. This would allow BSim to be utilised by the entire synthetic biology community, rather than just specialist modellers.

Venn Diagram comparing the skills required to operate BSim 2009 and the new GUI

Graphical User Interface (GUI) -What's new?

Past iGEM projects at BCCS-Bristol required knowledge of JAVA, mathematics and biochemistry. The 2009 edition of BSim relied heavily on the user’s knowledge of all three. By removing the need for JAVA knowledge, we have opened up BSim to a much wider category of users. The GUI only requires users to be able to express their biological system mathematically; it can then translate the user’s description of a system into JAVA code.

Who is the GUI aimed at?

The GUI is primarily aimed at users without any knowledge of JAVA. However, it is also of use to more advanced programmers, as it writes JAVA files that can be further modified using a text editor. This means advanced users can use the GUI to set a simple simulation which can be further tailored to their needs using JAVA. This saves a lot of time, as setting up a new simulation in BSim 2009 could take dozens of lines of code.

Simplifying BSim 2009

The main aims in creating the GUI were to reduce the time and background knowledge required to produce a BSim Simulation.

Creating Simulations in BSim 2009

The figure below shows the process of writing a simulation in the 2009 edition of BSim. All the steps of this process require knowledge of JAVA, and therefore are not accessible to the synthetic biological community in general. Additionally, there are too many steps in the process; slimming down the number of steps will make BSim easier to use.

Process diagram of the steps a user must go through to produce a simulation in BSim 2009

The steps in the above process are described in more detail below:

  1. The first step in the process is the ‘imports’ step. This portion of a JAVA file lists all the other files that should be searched when a function is called. This allows a programmer to call functions defined elsewhere, rather than having to define them explicitly within the main JAVA file.
  2. Creating a blank simulation, is uniform across whatever type of simulation a user wishes to run. Once a blank simulation is created, it behaves like a workspace into which additional objects and behaviours can be added.
  3. Setting simulation options allows the user to specify the size and boundary conditions for the simulation.
  4. Defining bacterial classes involves specifying in detail the behaviour of any species of bacteria required in the simulation. This would also be the stage at which users would specify other objects, such as chemical fields or mesh shapes.
  5. Once the types of bacteria have been defined, users must specify how many of each type of bacteria they want added to the simulation, and where their initial positions are. BSim can allocate random initial positions if needed.
  6. The ‘ticker’ is a device that performs all the actions required during each time step. In general, the functions that are performed in each time step are defined before this point, and simply called within the ticker. The ticker also serves as the simulation clock, keeping track of how much time has passed.
  7. The drawer is where the display properties of objects are described. Once the existence of an object is stated (in step 3), the drawer only needs to be told what colour to display that object in.
  8. The final step requires the user to state how the simulation data should be expressed. This can be in the form of an immediate preview, a recorded movie or image, or as raw data in CSV (Comma Separated Variables) format.

Creating Simulations using the GUI

The figure below shows the process of creating a simulation using the new BSim GUI. Note that, by packaging many of the previous steps together, this new process is cut down to 4 compulsary and 1 optional step. Also, none of the compulsary steps require the user to understand JAVA code.

Process diagram of the steps a user must go through to produce a simulation using the new GUI

The first step in the process is completed automatically as soon as the GUI is opened, without any further user interaction. The next three compulsary steps are handled through dialog boxes that can be reached via the GUI 'Home' screen. Users are required to enter data in the form of numbers or mathematical equations, and can choose between options using intuitive scroll-down menus.

Interface Design

Screenshot of GUI Home screen

Home Screen

The 'Home' screen is designed to be the hub to which all the functions of the GUI connect. As such, no feature of the GUI is more than 3 mouse-clicks away from the Home screen. This helps to keep the interface intuitive, and easy to learn.

The Home screen is divided into 3 sections:

  1. Menu bar
  2. Button Panel
  3. Text Output Area

The menu bar allows the user to exit the program, and links to the 'About' section of the GUI. The button panel (to the left of the Home screen) guides the user through the steps needed to create a simulation. Each of the buttons either opens dialog boxes or executes code. Finally, the text output area keeps track of the options selected by the user, which is immensely useful when creating complicated simulations.

Screenshot of GUI Simulation Options Dialog

Simulation Options

The 'Simulation Options' dialog can be opened by clicking on the highlighted button on the Home screen.

The first option open to the user is the simulation size (in microns). This is in the form of {x,y,z} co-ordinates, and the shape specified will always be a cuboid, but does not have to be a cube. No matter what size or shape the user chooses, the simulation camera will zoom in or out to show the entire simulation space at a reasonable size.

The second option defines the boundary conditions on the simulation space. These are stated as three boolean (true/false) values, relating to the {x,y,z} planar boundaries of the simulation cuboid. When set to 'true', the planar boundaries become collidable, meaning that objects that intersect them bounce off elastically in the opposite direction. This behaviour preserves the 'conservation of momentum' condition. If a boundary condition is set to 'false', then the associated plan boundaries are periodic. This means that an object passing through the boundary of the simulation will instantly be transported to an exact opposite spatial position within the simulation. Objects re-appear with the same velocity as they had before, preserving conservation of momentum.

The final option in ths dialog is the camera angle. This has to be stated in the form {i,j,k}, where i,j and k are real, positive numbers. The camera angle is calculated using the ratio of these three numbers.

Chemical Environment Options

Screenshot of GUI Chemical Environment options dialog