A program, code of which was written in both python and jawa languages, and simulates a structural analysis of DNA mutation through generations in a given image. The image is taken from an old meme of the «Banana Song» by youtuber Onision, which was uploaded in the 2009 and peeked in popularity in 2011, and no longer is referred to. It serves as a presentation of a living structure, that has a fatal error and unable to reproduce. In the series of images each generation changes from predecessor to descendant, as the genome of a new offspring mutates. The program uses a square of pixels and orders each division a nucleobase letter. According to the previous one, the next letter can only be paired with it (C + G / A + T). The program reads the RNA code, and in the next generation a random mutation can occur in the paired strings. The program continues to reproduce until a fatal error occurs resulting in abortion of script run, “killing the program”, leaving us with presented specimens. An inevitable death is a representation of life. Although the program has an inherited chance of error, in essence we simplified and simulated the biological process and mutation is a part of it. The project speaks about spread and viral replication, fitting of the species to the new «environment» and fossilization of the past through hypermedia.
{ STRING[] NUCLEOBASES = { 'C','G','A','T' }; ARRAYLIST<STRINGLIST> COPIES = NEW ARRAYLIST(); STRINGLIST NUCLEOTIDES = NEW STRINGLIST(); PIMAGE REFERENCE; INT GENERATIONS = 100; INT LNG; INT PIXSTEP = 50; INT RNALNG = 20; INT MUTATIONRATE = 80; BOOLEAN ABORT = FALSE; VOID SETUP() { SIZE(500,500); COLORMODE(HSB); LNG = WIDTH*HEIGHT/(PIXSTEP*PIXSTEP); REFERENCE = LOADIMAGE('REF.JPG'); IMAGE(REFERENCE, 0, 0); NOSTROKE(); FILL(150,0,0); // DNA-RNA INT RNASTART = INT(RANDOM(0,LNG-RNALNG)); INT RNAEND = RNASTART+RNALNG; INT FIRSTBASE = INT(RANDOM(0,NUCLEOBASES.LENGTH-1)); NUCLEOTIDES.APPEND(NUCLEOBASES[FIRSTBASE]); DNA(); PRINTLN('ST',JOIN(NUCLEOTIDES.ARRAY(),'')); TRANSCRIPTION(RNASTART,RNAEND); FOR (INT I=0; I<GENERATIONS; I++) { IF (!ABORT) { RNA(RNASTART); } ELSE { BREAK; } } PRINTLN('MRNA LOCATION: ',RNASTART,' – ',RNAEND); // CHECK ALL VALUES PIMAGE PROCESSED = REFERENCE.COPY(); IMAGE(REFERENCE, 0, 0); // PIMAGE STR = STRETCH(REFERENCE, 0,0, 100, 100,200, 100); // IMAGE(STR,0,0); INT FILENAME = 0; FOR (INT N=0; N<COPIES.SIZE(); N++) { STRING[] NU = COPIES.GET(N).ARRAY(); FOR (INT I=0; I<NU.LENGTH; I++) { INT X = I % (HEIGHT/PIXSTEP); INT Y = INT(I/(WIDTH/PIXSTEP)); INT CX = PIXSTEP/2 + X*PIXSTEP; INT CY = PIXSTEP/2 + Y*PIXSTEP; IF (NU[I] == 'A') { PROCESSED = TWIRL(PROCESSED,PIXSTEP, 10, 70, CX,CY); } IF (NU[I] == 'T') { PIMAGE REPL = REPLICATE(PROCESSED,PIXSTEP, X*PIXSTEP,Y*PIXSTEP); PROCESSED.BLEND(REPL, 10,10, REPL.WIDTH,REPL.HEIGHT, INT(RANDOM(0,WIDTH)),INT(RANDOM(0,HEIGHT)), REPL.WIDTH, REPL.HEIGHT, NORMAL); } IF (NU[I] == 'G') { INT NEXTG = 0; IF (I<NU.LENGTH) { FOR (INT CI=1; CI<NU.LENGTH-I; CI++) IF (NU[CI] == 'G') { NEXTG = CI; BREAK; } } // IF (I != 0) { // // IF (NEXTG == 0) { // // FOR (INT CI=-1; CI>I-NU.LENGTH; CI--) // // IF (NU[CI] == 'G') { // // NEXTG = CI; // BREAK; // } // // } // } PRINTLN(I,NEXTG); INT GX = (NEXTG % (HEIGHT/PIXSTEP)) *PIXSTEP; INT GY = (INT(NEXTG/(WIDTH/PIXSTEP)))*PIXSTEP; PROCESSED = STRETCH(PROCESSED, CX,CY, PIXSTEP, GX,GY,20); } // IF (NU[I] == 'C') { // // STROKE(255); FILL(0,0,255); RECT(200,200,20,20); // // } } FILENAME++; PROCESSED.SAVE('PR-'+FILENAME+'.JPG'); } IMAGE(PROCESSED, 0, 0); } VOID DRAW() {}