Team:Groningen/Brainstorm/Modelling

From 2009.igem.org

(Difference between revisions)
m ({{anchor|ModellingAGeneticCircuit}}Modelling a Genetic Circuit - TODO)
(Some small updates.)
 
(16 intermediate revisions not shown)
Line 65: Line 65:
It might be interesting to use JavaScript to present simulation results. This would allow for some degree of interaction (like resizing graphs, linked views, etc.) and may even make it somewhat easier to use graphs, we'd simply have some on-line repository of simulation results (a spreadsheet for example) and we could select which graphs to use on the Wiki.
It might be interesting to use JavaScript to present simulation results. This would allow for some degree of interaction (like resizing graphs, linked views, etc.) and may even make it somewhat easier to use graphs, we'd simply have some on-line repository of simulation results (a spreadsheet for example) and we could select which graphs to use on the Wiki.
-
Below an example of a JavaScript generated graph is shown, based on [http://spreadsheets.google.com/pub?key=rRnyFyi-bgqsjT3SdJBdKKw this spreadsheet]. Note that the two views of the data are linked (although at this time both the kind of graph and the link is not optimal) and that it would be possible to create templates for creating these linked graphs. The current demo is based on Google technology, but it looks like [http://www.dojotoolkit.org/ the Dojo Toolkit] has more advanced charting capabilities at this moment (although I don't know how well they're supported in different browsers).
+
Below an example of a JavaScript generated graph is shown, based on [http://spreadsheets.google.com/pub?key=rRnyFyi-bgqsjT3SdJBdKKw this spreadsheet]. Note that the two views of the data are linked (although at this time both the kind of graph and the link is not optimal) and that it would be possible to create templates for creating these linked graphs. The current demo is based on [http://www.dojotoolkit.org/ the Dojo Toolkit] as it has more advanced charting capabilities at this moment than Google visualization (and it seems to be supported well in different browsers).
-
<html>
+
{{GraphHeader}}
-
<div>
+
-
<span id="chart1"></span>
+
-
<span id="chart2"></span>
+
-
</div>
+
-
<table>
+
-
<tr>
+
-
<td id="dojochart1" style="width: 400px; height: 240px;"></td>
+
-
<td id="dojochart2" style="width: 400px; height: 240px;"></td>
+
-
</tr>
+
-
<tr>
+
-
<td align="center"><div id="dojolegend1"></div></td>
+
-
<td align="center"><div id="dojolegend2"></div></td>
+
-
</tr>
+
-
</table>
+
-
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+
-
<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.3.0/dojo/dojo.xd.js" djConfig="isDebug: false"></script>
+
-
<script type="text/javascript">
+
-
var loaded = 0;
+
{{graph|Team:Groningen/Graphs/Test}}
-
 
+
{{graph|Team:Groningen/Graphs/Test2}}
-
function onLoadCallback() {
+
-
  loaded++;
+
-
  if (loaded==2) {
+
-
    initialize(); // Google, Dojo is called when results from the query return.
+
-
  } 
+
-
}
+
-
 
+
-
<!-- Google part -->
+
-
 
+
-
// Load the Visualization API and the scatterchart package.
+
-
google.load('visualization', '1', {'packages':['scatterchart']});
+
-
 
+
-
// Set a callback to run when the API is loaded.
+
-
google.setOnLoadCallback(onLoadCallback);
+
-
 
+
-
var data, chart = [], view = [];
+
-
var dojochart = [], dojolegend = [];
+
-
 
+
-
function initialize() {
+
-
  // Initialize some global variables
+
-
  chart[0] = new google.visualization.ScatterChart(document.getElementById('chart1'));
+
-
  chart[1] = new google.visualization.ScatterChart(document.getElementById('chart2'));
+
-
  google.visualization.events.addListener(chart[0], 'select', function() { handleSelect(0); } );
+
-
  google.visualization.events.addListener(chart[1], 'select', function() { handleSelect(1); } );
+
-
 
+
-
  dojochart[0] = new dojox.charting.Chart2D("dojochart1");
+
-
  dojochart[0].addPlot("default", {type: "Lines"});
+
-
  dojochart[0].addAxis("x");
+
-
  dojochart[0].addAxis("y", {vertical: true});
+
-
  dojolegend[0] = new dojox.charting.widget.Legend({chart: dojochart[0]}, "dojolegend1");
+
-
  dojochart[1] = new dojox.charting.Chart2D("dojochart2");
+
-
  dojochart[1].addPlot("default", {type: "Lines"});
+
-
  dojochart[1].addAxis("x");
+
-
  dojochart[1].addAxis("y", {vertical: true});
+
-
  dojolegend[1] = new dojox.charting.widget.Legend({chart: dojochart[1]}, "dojolegend2");
+
-
 
+
-
  // Query spreadsheet and let result be drawn
+
-
  var query = new google.visualization.Query('http://spreadsheets.google.com/pub?key=rRnyFyi-bgqsjT3SdJBdKKw');
+
-
  query.send(drawChart);
+
-
}
+
-
 
+
-
function drawChart(response) {
+
-
  if (response.isError()) {
+
-
    alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
+
-
    return;
+
-
  }
+
-
 
+
-
  data = response.getDataTable();
+
-
  view[0] = new google.visualization.DataView(data);
+
-
  view[1] = new google.visualization.DataView(data);
+
-
  view[1].hideColumns([0]);
+
-
 
+
-
  chart[0].draw(view[0], {width: 400, height: 240, lineSize: 1});
+
-
  chart[1].draw(view[1], {width: 400, height: 240, lineSize: 1});
+
-
 
+
-
  makeCharts(); // Dojo call
+
-
}
+
-
 
+
-
function handleSelect(chartIndex) {
+
-
  var selection_org = chart[chartIndex].getSelection();
+
-
  var view_org = view[chartIndex];
+
-
  for(var c=0; c<chart.length; c++) {
+
-
    if (c==chartIndex) continue;
+
-
    var selection_new = [];
+
-
    var view_new = view[c];
+
-
    for(var i=0; i<selection_org.length; i++) {
+
-
      var item_org = selection_org[i];
+
-
      var item = {'row': (item_org.row!=null ? view_org.getTableRowIndex(item_org.row) : null),
+
-
                  'column': (item_org.column!=null ? view_org.getTableColumnIndex(item_org.column) : null)}
+
-
      var item_new = {'row': (item.row!=null ? view_new.getViewRowIndex(item.row) : null),
+
-
                      'column': (item.column!=null ? view_new.getViewColumnIndex(item.column) : null)}
+
-
      if (item_new.row==-1) continue; // Skip items that are not represented in this view
+
-
      if (item_new.column==-1) continue;
+
-
      selection_new.push(item_new);
+
-
    }
+
-
    chart[c].setSelection(selection_new);
+
-
  }
+
-
}
+
-
 
+
-
<!-- Dojo part -->
+
-
 
+
-
function seriesFromDataTable(view) {
+
-
  var seriesArray = [];
+
-
  for(var c=1; c<view.getNumberOfColumns(); c++) {
+
-
    var series = [];
+
-
    for(var r=0; r<view.getNumberOfRows(); r++) {
+
-
      series.push({x: view.getValue(r,0), y: view.getValue(r,c)});
+
-
    }
+
-
    seriesArray.push({title: view.getColumnLabel(c), data: series});
+
-
  }
+
-
  return seriesArray;
+
-
}
+
-
 
+
-
dojo.require("dojox.charting.Chart2D");
+
-
dojo.require("dojox.charting.widget.Legend");
+
-
makeCharts = function(){
+
-
  for(var s=0; s<view.length; s++) {
+
-
    var series = seriesFromDataTable(view[s]);
+
-
    for(var i=0; i<series.length; i++) {
+
-
      dojochart[s].addSeries(series[i].title, series[i].data);
+
-
    }
+
-
    dojochart[s].render();
+
-
    dojolegend[s].refresh();
+
-
  }
+
-
};
+
-
dojo.addOnLoad(onLoadCallback);
+
-
</script>
+
-
</html>
+
Questions that would have to be resolved include:
Questions that would have to be resolved include:
* How can we make this easy to use?
* How can we make this easy to use?
 +
** The graphs can now be defined using a more or less normal Wiki page and allow the use of templates.
* What kinds of plots do we need?
* What kinds of plots do we need?
* How flexible do we need it to be? (Layout-wise.)
* How flexible do we need it to be? (Layout-wise.)
* Can we make it that flexible? (And still easy to use.)
* Can we make it that flexible? (And still easy to use.)
-
* Do we want to keep referring to parts of a spreadsheet or do we want to be able to select parts by the parameters used?
+
<!--* Do we want to keep referring to parts of a spreadsheet or do we want to be able to select parts by the parameters used?-->
* Can we create a relatively easy way to let the viewer select different data for exploratory purposes? We will likely run more simulations than you would normally graph.
* Can we create a relatively easy way to let the viewer select different data for exploratory purposes? We will likely run more simulations than you would normally graph.
 +
* How to support axis titles?
 +
** Currently done using some custom code (created by someone else and submitted to Dojo's bug tracker).
* ???
* ???
Taking this idea (much) further it would even be possible to run simulations using JavaScript (and charting the results), based on SBML models. However, this would involve much, much more effort than just showing a few interactive plots.
Taking this idea (much) further it would even be possible to run simulations using JavaScript (and charting the results), based on SBML models. However, this would involve much, much more effort than just showing a few interactive plots.
 +
 +
::Note that we did implement simulations in JavaScript, but based on a function that return the time-derivatives given the current state. In principle this is surprisingly fast (in some cases graphing was the bottle-neck, leading us to subsample the simulated time series for graphing purposes) and it should be relatively easy to adapt to other models. Note that we only used a very simple integration scheme though (so if your model requires a more advanced integration scheme you'll have to program it yourself).
=={{anchor|ModellingAGeneticCircuit}}Modelling a Genetic Circuit - TODO==
=={{anchor|ModellingAGeneticCircuit}}Modelling a Genetic Circuit - TODO==
Line 217: Line 97:
* Model interaction of relevant substances. This requires reaction formulas for all the substances with (known) reaction rates, as well as information on how the substance diffuses (unless it is assumed the model is "well-mixed").
* Model interaction of relevant substances. This requires reaction formulas for all the substances with (known) reaction rates, as well as information on how the substance diffuses (unless it is assumed the model is "well-mixed").
* Link to the world outside the cell and macroscopic effects, like cell density. Note the medium is usually well-known.
* Link to the world outside the cell and macroscopic effects, like cell density. Note the medium is usually well-known.
 +
* Create a kind of mind map of the processes involved to show how the model could be refined.
 +
* Formulate what aspects of the modelling results are essential. So, for example that some concentration rises as a result of the presence of a substance, or that the bacteria actually float. (Can we use mathematical topology as a criterium?)
This can be done using one of the following methods:
This can be done using one of the following methods:
Line 225: Line 107:
Questions:
Questions:
* What exactly is the role of a kinetic law in modelling a reaction?
* What exactly is the role of a kinetic law in modelling a reaction?
 +
** A kinetic law is usually a generic equation describing the rate of a certain class of reactions in terms of the reactant concentrations and some constants. (For example the [[Team:Groningen/Glossary#MichaelisMenten|Michaelis-Menten equation]].)
 +
 +
==Purpose of Modelling==
 +
* Descriptive, it can help describe the system.
 +
* As verification of the design.
 +
* Predictive, it can help predict results to aid in selecting physical parameters. (How many copies of a gene? What concentrations? etc.)
 +
* As tool in designing tests. What tests will give the best discrimination, etc.
==Literature==
==Literature==
See our [[Team:Groningen/Literature|literature list]] for a full overview of all literature. For our team members that are looking for books on the subject, have a look under code [http://opc.ub.rug.nl/DB=1/SET=2/TTL=1/CLK?IKT=8110&TRM=605B 605B] (Bernoulliborg library, lower floor), as well as 605C/D/E (A and Z also exist but seem to be less interesting) and 610A (and possibly 625, 715).
See our [[Team:Groningen/Literature|literature list]] for a full overview of all literature. For our team members that are looking for books on the subject, have a look under code [http://opc.ub.rug.nl/DB=1/SET=2/TTL=1/CLK?IKT=8110&TRM=605B 605B] (Bernoulliborg library, lower floor), as well as 605C/D/E (A and Z also exist but seem to be less interesting) and 610A (and possibly 625, 715).
 +
{{Team:Groningen/Footer}}

Latest revision as of 17:06, 14 February 2010

[http://2009.igem.org/Team:Groningen http://2009.igem.org/wiki/images/f/f1/Igemhomelogo.png]


Software tools from previous years

Other potentially interesting software tools:

Interactive Graphs?

It might be interesting to use JavaScript to present simulation results. This would allow for some degree of interaction (like resizing graphs, linked views, etc.) and may even make it somewhat easier to use graphs, we'd simply have some on-line repository of simulation results (a spreadsheet for example) and we could select which graphs to use on the Wiki.

Below an example of a JavaScript generated graph is shown, based on [http://spreadsheets.google.com/pub?key=rRnyFyi-bgqsjT3SdJBdKKw this spreadsheet]. Note that the two views of the data are linked (although at this time both the kind of graph and the link is not optimal) and that it would be possible to create templates for creating these linked graphs. The current demo is based on [http://www.dojotoolkit.org/ the Dojo Toolkit] as it has more advanced charting capabilities at this moment than Google visualization (and it seems to be supported well in different browsers).

Loading graph...
Loading graph...

Questions that would have to be resolved include:

  • How can we make this easy to use?
    • The graphs can now be defined using a more or less normal Wiki page and allow the use of templates.
  • What kinds of plots do we need?
  • How flexible do we need it to be? (Layout-wise.)
  • Can we make it that flexible? (And still easy to use.)
  • Can we create a relatively easy way to let the viewer select different data for exploratory purposes? We will likely run more simulations than you would normally graph.
  • How to support axis titles?
    • Currently done using some custom code (created by someone else and submitted to Dojo's bug tracker).
  •  ???

Taking this idea (much) further it would even be possible to run simulations using JavaScript (and charting the results), based on SBML models. However, this would involve much, much more effort than just showing a few interactive plots.

Note that we did implement simulations in JavaScript, but based on a function that return the time-derivatives given the current state. In principle this is surprisingly fast (in some cases graphing was the bottle-neck, leading us to subsample the simulated time series for graphing purposes) and it should be relatively easy to adapt to other models. Note that we only used a very simple integration scheme though (so if your model requires a more advanced integration scheme you'll have to program it yourself).

Modelling a Genetic Circuit - TODO

To model a genetic circuit the following must be done (TODO: more detail):

  • Determine which genes are involved and how they are regulated???
  • Model gene transcription? (How?) Try to avoid this, try going directly to protein.
  • Model gene translation? (How?) Try to avoid this, try going directly to protein.
  • Model degradation? (How?)
  • Model interaction of relevant substances. This requires reaction formulas for all the substances with (known) reaction rates, as well as information on how the substance diffuses (unless it is assumed the model is "well-mixed").
  • Link to the world outside the cell and macroscopic effects, like cell density. Note the medium is usually well-known.
  • Create a kind of mind map of the processes involved to show how the model could be refined.
  • Formulate what aspects of the modelling results are essential. So, for example that some concentration rises as a result of the presence of a substance, or that the bacteria actually float. (Can we use mathematical topology as a criterium?)

This can be done using one of the following methods:

  • One ordinary differential equation per substance involved, reflecting the different reaction formulas and rates.
  • If the spatial distribution of substances needs to be taken into account partial differential equations can be used. This is probably not necessary when talking about large numbers of bacteria.
  • Stochastic modelling can be used if needed (if we deal with very low concentrations for example).

Questions:

  • What exactly is the role of a kinetic law in modelling a reaction?
    • A kinetic law is usually a generic equation describing the rate of a certain class of reactions in terms of the reactant concentrations and some constants. (For example the Michaelis-Menten equation.)

Purpose of Modelling

  • Descriptive, it can help describe the system.
  • As verification of the design.
  • Predictive, it can help predict results to aid in selecting physical parameters. (How many copies of a gene? What concentrations? etc.)
  • As tool in designing tests. What tests will give the best discrimination, etc.

Literature

See our literature list for a full overview of all literature. For our team members that are looking for books on the subject, have a look under code [http://opc.ub.rug.nl/DB=1/SET=2/TTL=1/CLK?IKT=8110&TRM=605B 605B] (Bernoulliborg library, lower floor), as well as 605C/D/E (A and Z also exist but seem to be less interesting) and 610A (and possibly 625, 715).