205
$\begingroup$

Does DNA have anything like IF-statements, GOTO-jumps, or WHILE loops?

In software development, these constructs have the following functions:

  • IF-statements: An IF statement executes the code in a subsequent code block if some specific condition is met.
  • WHILE-loops: The code in a subsequent code block is executes as many times as specified, or as long as a specific condition is met.
  • Function calls: The code temporarily bypasses the subsequent code block, executing instead some other code block. After execution of the other code block the code returns (sometimes with some value) and continues the execution of the subsequent block.
  • GOTO-statements: The code bypasses the subsequent code block, jumping instead directly to some other block.

Are constructs similar to these present in DNA? If yes, how are they implemented and what are they called?

$\endgroup$
19
  • 48
    $\begingroup$ while(telomeres>0){DNA.replicate;cell.divide;telomeres-=1;sleep(x);} $\endgroup$ Commented Mar 4, 2015 at 4:56
  • 19
    $\begingroup$ A function call is just a fancy GOTO statement. $\endgroup$
    – user
    Commented Mar 4, 2015 at 9:08
  • 4
    $\begingroup$ To me, GOTO only makes sense for sequential code execution, and this is not the case for DNA (lots of transcription is happening all the time in parallel). $\endgroup$ Commented Mar 4, 2015 at 10:26
  • 10
    $\begingroup$ @MichaelKjörling A fuction call necessitates that there be a separate environment for the function. It can take arguments as inputs and returns some output. GOTO on the other hand is the part of the main program and just controls the flow of instructions. While the information flow in biological system can be controlled, it is almost impossible to provide a separate environment necessary for true functions. $\endgroup$
    – WYSIWYG
    Commented Mar 4, 2015 at 11:35
  • 3
    $\begingroup$ I think with DNA we are closer to bits and bytes themselves or maybe machine code than to a programming language. $\endgroup$
    – skymningen
    Commented Mar 4, 2015 at 12:27

7 Answers 7

145
$\begingroup$

Biological examples similar to programming statements:

  • IF : Transcriptional activator; when present a gene will be transcribed. In general there is no termination of events unless the signal is gone; the program ends only with the death of the cell. So the IF statement is always a part of a loop.
  • WHILE : Transcriptional repressor; gene will be transcribed until repressor is not present.
  • There are no equivalents of function calls. All events happen is the same space and there is always a likelihood of interference. One can argue that organelles can act as a compartment that may have a function like properties but they are highly complex and are not just some kind of input-output devices.
  • GOTO is always dependent on a condition. This can happen in case of certain network connections such as feedforward loops and branched pathways. For example if there is a signalling pathway like this:
    A → B → C and there is another connection D → C then if somehow D is activated it will directly affect C, making A and B dispensable.

Logic gates have been constructed using synthetic biological circuits. See this review for more information.


Note

Molecular biological processes cannot be directly compared to a computer code. It is the underlying logic that is important and not the statement construct itself and these examples should not be taken as absolute analogies. It is also to be noted that DNA is just a set of instructions and not really a fully functional entity (it is functional to some extent). However, even being just a code it is comparable to a HLL code that has to be compiled to execute its functions. See this post too.

It is also important to note that the cell, like many other physical systems, is analog in nature. Therefore, in most situations there is no 0/1 (binary) value of variables. Consider gene expression. If a transcriptional activator is present, the gene will be transcribed. However, if you keep increasing the concentration of the activator, the expression of that gene will increase until it reaches a saturation point. So there is no digital logic here. Having said that, I would add that switching behaviour is possible in biological systems (including gene expression) and is also used in many cases. Certain kinds of regulatory network structures can give rise to such dynamics. Co-operativity with or without positive feedback is one of the mechanisms that can implement switching behaviour. For more details read about ultrasensitivity. Also check out "Can molecular genetics make a boolean variable from a continuous variable?"

$\endgroup$
20
  • 15
    $\begingroup$ I would classify intron splicing as a kind of GOTO, since it essentially skips the ribosome "pointer" to a different value. $\endgroup$
    – March Ho
    Commented Mar 4, 2015 at 6:01
  • 1
    $\begingroup$ Very nice! Where would alternate reading frames fit in? $\endgroup$
    – One Face
    Commented Mar 4, 2015 at 7:36
  • 14
    $\begingroup$ While your examples are clever I feel the analogy used here (DNA against computer code) is so very poor as to be misleading. $\endgroup$ Commented Mar 4, 2015 at 13:03
  • 3
    $\begingroup$ @JackAidley It is true that molecular biology cannot be directly compared to a computer code. I intended this answer for someone who is curious if a cell can perform computations like a computer program. I already mentioned that it is the underlying logic that is important and not the statement construct itself and these examples should not be taken as absolute analogies. I'll add this in the answer to avoid confusion. $\endgroup$
    – WYSIWYG
    Commented Mar 4, 2015 at 13:10
  • 2
    $\begingroup$ WYSIWYG, it's good that you did not mention that DNA is performing all the functions you describe, but you should really consider explicitly mentioning in your answer that DNA doesn't and can't perform them; the fact that computer code describes such control structures really is a pretty fundamental aspect of Turing-completeness, and it's very important in the context of this question to note that DNA does not share that feature. $\endgroup$ Commented Mar 4, 2015 at 17:09
22
$\begingroup$

DNA is not analogous to computer code which renders your search for similar constructs in it meaningless. To give a couple of simple examples why this is:

  • Computer code has a sequential order of execution; DNA acts in parallel and out of sequence, it is not "executed".

  • Computer code has a strict and consistent meaning so the line if x==4 : x=7 always does the same thing; coding DNA translates to amino acids and it's the complex chemical interactions between these acids which give proteins their function thus no piece of coding DNA can be understood outside of its protein.

Biological systems do have some pathways that operate in a similar way to computers, but you should be looking for these at the protein level not the DNA level and, even then, you need to be extremely careful that your analogy does not impair your understanding of what is really happening.

$\endgroup$
9
  • 4
    $\begingroup$ When you say DNA needs proteins to execute its functions then computer programs also need compilers to execute their code. It is ultimately the machine language that tells the computer what to do. $\endgroup$
    – WYSIWYG
    Commented Mar 4, 2015 at 13:17
  • 1
    $\begingroup$ I'm not saying that DNA needs proteins to execute its functions; I'm saying DNA is fundamentally unlike computer code. $\endgroup$ Commented Mar 4, 2015 at 14:36
  • 4
    $\begingroup$ OK, but there exist massively parallel programming languages Where every line is executed at the same time and can be out of sequence. And just because lines are context sensitives does not make it not a programming language, it just makes it far more complex. That said, the way I understood DNA it was more data than program. $\endgroup$
    – Jonathon
    Commented Mar 5, 2015 at 18:31
  • 3
    $\begingroup$ Even in parallel programming languages, each statement in executed sequentially. It's just that there are multiple "threads" of execution going at the same time. DNA is neither data nor program. The analogy is totally inaccurate. $\endgroup$ Commented Mar 5, 2015 at 22:33
  • 2
    $\begingroup$ I think DNA is data and program at the same time. Its regulators of expression act as logic clauses, so the analogy is at least curious. $\endgroup$
    – Rodrigo
    Commented Sep 27, 2015 at 18:23
20
$\begingroup$

There are certainly some comparisons that could be made between the way genes are expressed from DNA and logic functions, but they aren't great.

But synthetic Biology is really a blossoming new field that is attempting to integrate logic functions into biology, see e.g. Siuti et al (2013).

The above paper is a brilliant example of a group using bacteria to store information and assembling into biological circuits that can then be used to process logic functions. So its being done but not exactly in the way that you propose.

$\endgroup$
15
$\begingroup$

Just to add to previous answers, but transcriptional interference (see e.g. Shearwin et al., 2005) can be seen as a form of IF-statement (or WHILE) in the sense that:

if(x transcribed){not y transcribed}

The interference does not have to be binary though, and more common are graded responses. Transcriptional interference can also take place at the RNA stage (see e.g. Xue et al, 2014), using antisense RNA and often providing a negative feedback loop, but the interference is then removed from the DNA, and does not represent a direct IF-statement analog at the DNA stage.

To me, GOTO mainly makes sense for sequential code execution, and this is not the case for DNA (lots of transcription is happening all the time in parallel). More generally, the parallel "execution" of DNA along with the continuous interactions and feedback loops between DNA, transcripts and proteins (among other things) also means that cellular processes are far less clear-cut and traceable than computer code, which means that computer code is a very poor metaphor for cellular processes and the functioning of DNA.

$\endgroup$
2
  • 3
    $\begingroup$ I think the intrinsic parallelism is a key point. Biological 'processing' is really more analog than digital, as even discrete neuron firing is an encoding of analog processes in the neuron. The processes of a cell are much better approximated as a horrendously (gloriously?) complex set of overlapping, cross-wired analog feedback loops. Gene expression makes up part of this, though it is intimately tied into many other cellular processes. $\endgroup$
    – Dan Bryant
    Commented Mar 4, 2015 at 19:57
  • $\begingroup$ @DanBryant Great description and agreed - I have tried to clarify this point further. $\endgroup$ Commented Mar 4, 2015 at 22:30
12
$\begingroup$

As WYSIWYG said there is no equivalent for function calls, as there will always be some interference. However one could argue that some modular pathways (eg. apoptosis signalling) can be seen as a "code block" where a certain input will (almost) certainly lead to a certain effect. The analogy with function calls is that, in describing many different mechanisms, it makes for shorter and more efficient "code" to consider everything between eg. caspase activation and cytochrome leakage as one block. Also, marking a protein with ubiquitin can maybe be seen as a function call for degradation.

If you are interested in the building blocks for programming with biology, check out the biobricks.org program, which aims to define modular parts (bricks) which can be sensors, logic functions, effectors,...

$\endgroup$
1
  • 2
    $\begingroup$ There is interference in function calls too: they're called global variables, system configuration, hardware support, etc. $\endgroup$
    – Rodrigo
    Commented Sep 27, 2015 at 18:26
3
$\begingroup$

Regarding function calls:

There are no equivalents of function calls. All events happen is the same space and there is always a likelihood of interference. One can argue that organelles can act as a compartment that may have a function like properties but they are highly complex and are not just some kind of input-output devices.

and

As WYSIWYG said there is no equivalent for function calls, as there will always be some interference.

I think that nuclear receptors are great examples of function calls. They hang out in the cytosol allowing normal programming to function in a normative fashion. Upon activation with their ligand, they translocate to the nucleus to activate subroutines of gene repression/activation and subsequent downstream processes.

In this fashion one could even argue that most initial ligand interactions that kick off cellular signaling are function calls.

$\endgroup$
1
$\begingroup$

In addition to the excellent WYSIWYG answer, there are some programming-like constructs at the lower level:

  • FUNCTION CALL - replacing a single sub-unit inside a complex protein, assembled from multiple sub-units, each encoded by separate genes. This can also be seen as COMPOSITION, another programming concept.
  • IF - alternative splicing, a piece of DNA (exon) may be included or not included into transcript that encodes the final protein.
$\endgroup$
1
  • 1
    $\begingroup$ I rolled back the edit that put back tics around portions of this answer that are not code. Here, FUNCTION CALL, COMPOSITION, and IF are not code, they are programming concepts $\endgroup$
    – De Novo
    Commented Mar 13, 2019 at 4:22

You must log in to answer this question.