Showing posts with label simulation. Show all posts
Showing posts with label simulation. Show all posts

Thursday, July 30, 2009

Welcome SidLit!

Science Simulations for students in Second Life at SidLit July 31, 2009.
















Welcome from Simone Gateaux and her carbon based side kick Paul Decelles!

Install the Second Life viewer first and create your avatar.

SLURL to Sidlit Notecard with landmarks:
http://slurl.com/secondlife/Carmine/87/145/135

When you arrive, touch on the box which will offer you a note card with landmarks to the sites discussed in my presentation. Accept the note card into your inventory.

Other links-not SLURLS:

Some scripting resources:

Scratch for Second Life:
http://web.mit.edu/~eric_r/Public/S4SL/

Autoscript: A web based script generator:
http://www.3greeneggs.com/autoscript/


Other virtual World Systems:

Virtual Worlds: Best Practices in Education 2009:
http://www.vwbpe.org/

Wonderland
Blog Entry about Wonderland:
http://slbiology.blogspot.com/2009/03/wonderland.html

Sun's Wonderland Site:
https://lg3d-wonderland.dev.java.net/index.html

Video about iSocial at U of Missouri in Columbia MO:



OpenSim Links:
Blog entry about OpenSim and Intel's Science Island:
http://slbiology.blogspot.com/2009/03/opensim.html
OpenSim main site:
http://opensimulator.org/wiki/Main_Page

Exit Reality
Blog Entry about Exit Reality:
http://slbiology.blogspot.com/2009/02/another-virtual-reality-system.html

Exit Reality Site:
http://3d.exitreality.com/

Tuesday, July 21, 2009

Mitosis I Wigglies



Animated and wiggly duplicated chromosomes (Reddish wormie things*) scripted to separate and behave as they do during anaphase. The green structures are the paired centrioles, the pink box when touched tells the sister chromatids...those are the wigglies... to separate into unduplicated chromosomes.

*notice the precise biological terminology in this post.

Friday, May 29, 2009

What's going on at the lab?

My protein synthesis functions, got me thinking about developing an animated model of protein synthesis that actually does transcription and translation and so I have been trying to figure out a good way to do this. The figure shows a animated prototype for an operon that I have been working on. The model loosely mimics the behavior of the repressor protein and inducer of the lac operon as well as the RNA polymerase.

In the picture the repressor protein (red) is sitting on the operator and the RNA polymerase(purple) cannot attach to the promoter to begin transcription of the operon's coding region (teal). The inducer is the green ball. The can see how the system behaves by touching say the inducer which will then bind to the repressor protein, preventing it from blocking the RNA polymerase.

This view shows the repressor protein not on the operator allowing the RNA polymerase to begin transcription. As the polymerase moves down the coding region the transcript (yellow) grows.










When the RNA polymerase reaches the terminator part of the operon the polymerase detaches, the RNA detaches and the small ribosomal subunit (brown) attaches to the start of the start of the transcript.

Obviously there are some simplifications here. For instance in prokaryotes translation can begin while transcription is still on going and I don't bother with the details of how RNA polymerase works.

The goal is to let the students input a short DNA sequence, animate transcription and show the mRNA in local chat (or perhaps as hovering text above the mRNA) and optionally send it as an e-mail. Then as translation proceeds actually have the tRNA's bring in the amino acids and make a short polypeptide. In this scheme the mRNA is a single prim but carries the codons as data inside. But the development of the polypeptide via translation is explicitly animated in terms of what happens at the ribosome, each amino acid shown as a separate object.

In the foreground are some crude tRNA's (orange rectangles) some of which have amino acids represented by balls attached to them. This is going to be a fairly elaborate scripting effort with some neat tricks involved so stay tuned...

My sabbatical is officially over and have already given my sabbatical report. I will be teaching summer school-just two intro biology lecture sections. Also at the end of July I will be speaking on Science simulations in Second Life at SidLit and giving also giving several local talks about Second Life in general.

Tuesday, April 14, 2009

Evolution II 101 Dalmations?

Well no, how about 30 Caminalcules after selection favoring a recessive allele for 8 generations. The natural selection module beta is finished and works very well. The basic strategy is to have the user or users act as visual predators removing camis from the population. The module might for instance be on a certain background where some cami phenotypes are real obvious while others are not.

The "predators" remove cami's by touching them, and the population is up dated. After a set period of time say 1 minute the remaining cami's are used to make a new population, which the module generates when it is touched and the cycle is repeated until only one genotype remains or until the users give up.

At the start of each generation the module generates a report in chat on the screen showing the allele frequencies for both of the cami loci.

If Cami's are never "eaten" the result is genetic drift. So this module really combines genetic drift and natural selection. It does not use or even compute selection coefficients, but one could add that to a report.

Saturday, April 11, 2009

A certain cell membrane...

My biology viewers might recognise what this SL model is supposed to be.

Membrane of a certain cell

This is a preliminary prototype for a neuron membrane showing stylised transport proteins (purple). The round guys with the lids are gated sodium proteins the lidless tubes are gated potassium channel proteins. The "lids" on the sodium gates will be scripted to pop open to let Na+ ions through while the bottoms of the K+ channels will flip open and closed.

The oval shaped guy on the right is part of a Na+/K+ pump.

All these proteins are embedded in a stylised plasma membrane (red fatty acid residues connected to white polar heads with phosphorus for the phospholipids).

This project is actually part of a planned metabolism build which uses the neuron to illustrate how cells use active and passive transport for complex processes. So it's not meant as a full action potential simulation though my scripting strategy will take that possibility into account.

Friday, April 3, 2009

The Cami Lab is up!















The Caminalcules
(camis for short) have been safely installed in a Mendelian Genetics lab module called the Cami Lab. I use my note card configurable camis to illustrate dominance relations, monohybrid crosses, and dihybrid crosses. The evolution module will be directly underneath.

I have had to readjust my land and merge several parcels to give me some prim breathing room. Feel free to come and visit Cami Lab currently at:

http://slurl.com/secondlife/Carmine/128/144/136

As part of this, I rescripted my simple viewer to use Erich Bremer's double buffering script which makes loading much faster. My essentially new viewer uses LSL's way cool llDetectedTouchST function. This function detects where on a prim's surface you are touching and returns that as the x and y terms of a vector.

You can then access, these to do things like change a slide or teleport. What is really cool is that the coordinates are normalized to the size of the prim so they are presented as a float between 0.0 and 1.0, so if you stretch, say a viewer, the detected function still works properly.

Wednesday, April 1, 2009

Evolution I: Simulating genetic drift with Caminalcules

So far I been working with my caminalcules in terms of genetics. But of course-and maybe someone ought to tell creationists about this-evolution and genetics are logically connected and evolution follows from genetics. So naturally I want to use my system to simulate the basic mechanisms of evolution.

Yesterday and today I programed a prototype Evolver (pink square) that simulates genetic drift. Genetic drift is an agent of evolution where a population's genetic make up changes due to sampling error. Drift is particularly important for small populations, such as caminalcule populations which given the prim limits in SL can never be very big.

Genetic drift is actually easier to simulate than natural selection, so it makes a good starting point for scripting and probably also for students to play with.

To look at populations of caminalcules I treat the population as a list containing the genotypes of all the individuals in the population. I use the same phenotype routines developed for genetics crosses and simply can access the approriate caminalcule through the list index.

Next I had to write a series of population functions:

string randommating(list the_pop) chooses two individuals from the population at random to mate and produces one offspring.

initialise(integer popsize) produces an initial random population and stores it in a list called start_pop_list and returns that list after rezzing an offspring:

Here's a snippet form this function:

start_pop_list = start_pop_list + genotype;
pass2offspring = (integer)genotype;
llRezObject("bigpup",llGetPos()+<2.0-llfrand(4),2.0-llfrand(4),0>,<0,0,0>,<0,pi/4,0,0>, pass2offspring);
}
while (++icount
return start_pop_list;

Most of the other routines are functions made before for the Caminalcule genetics module. So there is nothing new here. The simulation is direct in that I do not calculate allele frequencies and sample from that.

Doing random mating is pretty easy and here is the new function that handles that:

string randommating(list the_pop)
{
integer index;
string organism1;
string organism2;
string thezygote;
string gamete1;
string gamete2;
integer pop_size = llGetListLength(the_pop);
index = irandom(0, pop_size-1);
organism1 = llList2String(the_pop,index);
gamete1 = make_a_gamete(organism1);
index = irandom(0, pop_size-1);
organism2 = llList2String(the_pop,index);
gamete2 = make_a_gamete(organism2);

//----pick 2 organisms at random to mate from the_pop, self mating allowed----
//list the_pop must have been checked!


return make_zygote_string("4",gamete1, gamete2);
//4 because we assume independence here
}


Well so what happens with genetic drift? I want to write routines to quantitatively track what happens, but for many situations running the drift script for for a number of trials ought to get the idea across so here are some pictures from two sets of runs.

My first run started with a population that looked like this:


Four generations later...

Notice the pink and green phenotypes are becoming more common. The the genes related to the white caminalcules have apparently been eliminated. Since the genes related to the white photype are recessive the student might think (as did some geneticicts in the early 20th century) that the recessive allele ought to dissappear over time any way.

By the 11th generation all you have are these caminalcules:

Actually the picture shows the population after 14 generations since I wanted to make sure the other types were eliminated. This nicely shows that the effect of genetic drift is to reduce genetic variation in a population.

Now consider a trial starting with this population:

Not very different than the starting population from the previous run. But look what happens now! This is at generation 10. Note the large number of white caminalcules. Remember white is recessive.



And by generation 15:


Only the white caminacules are left and it looks like only one type of spotting! This illustrates two points. First of all as I noted earler, recessive alleles are not eliminated just because they are recessive, but evolution is strongly contingent. Just because you get one result one time, the chance elements in evolution such as genetic drift may cause completely different out comes the following time. This can lead students and teachers into all sorts of interesting avenues of thinking about how evolution works!

If you want to see how this works, look for me in world.

Hopefully later this week I will have worked through natural selection.






Saturday, March 28, 2009

Configurable Caminalcules!















One thing I wanted for my Caminalcules
to is allow for the instructor to configure different genetic systems via a note card rather than a menu system. Turned out to be pretty easy and so in amongst Best Practices Workshops, I've been squeezing out time for this.

So here is an example of a pair of Caminalcules who have indulged in a little bit of dihybrid Mendelian interaction. I'm making little activity pens or corrals (as Max Chatnoir suggests) for them partly to keep them in but because when the pups are "born" sometimes they don't end up right side up. Visitors can move them around with fear that they are going to escape!

I need to give them some sort of movement but that will need to wait and I will probably introduce that option in a couple weeks when I script my Caminalcule evolution activity.

Friday, March 27, 2009

Caminalcules Spotted at Genome Island!

No need to panic. I sent Max Chatnoir a pair of them for her to break as a beta tester, which she very nicely did in about 1 minute. So made some changes based on her feedback. The Caminalcules can now do various modes of inheritance and can either mate with each other of self fertilize as any proper organism for genetic studies ought to be able to do. Did I mention they also do linked genes? The picture show Max with her first brood. There had been a problem with permissions which caused a bit of grief until I tracked the problem down.






This coming week will see lots of frantic designing and building for the Caminalcule project including plans for a build on Genome Island once the prototype build is finished at Carmine. But a good part of today and Saturday I will be at the Virtual World best Practices Conference. Oops! Starting in about 10 minutes.

Friday, March 13, 2009

Virtual Worlds-Best Practices in Education

I will be attending, but not presenting at this conference in late March(27th -29th)...look for Simone. Not sure where in SL it will be held. They do have a rack on simulation and gaming so I plan to be learning (I hope) and blogging.

Go to

http://www.vwbpe.org/

for registration and schedule information.

Thursday, March 5, 2009

Caminalcules III Colorful pups...
















This week I implemented a version
of Eloise Pasteure's suggestion to get genetic data into the Caminalcule's offspring, representing the genetic data as a 7 digit integer. This integer has two positions for each locus or allele pair, a dominance term which is 1 position for each locus and an extra flag telling the program whether to process one or both loci when making the phenotype of the offspring. It's a little less compact than what Eloise suggested but easier for me to keep track of.

This version of the Caminalcule will illustrate Mendel's two laws and does not do linkage...yet. The second locus, by the way, has to do with the type and number of black spots on the critter and I just got that implemented today.

Yet to do are some fixes to the menu system- I've had to think carefully how the lldialog function works-and think out the mechanics of Caminalcule mating. How will they communicate and behave? Right now they can detect each other with sensors but I haven't given them an sort of movement. What happens if two encounter each other and they are genetically incompatible? What sort of reproductive system? We already know that some of them are hermaphroditic. Is there also a non hermaphroditic gender? Hmmmm. Stranger things than this happen in nature. You might look up the life cycle of Caenorhabditis elegans, one of the major organisms in modern genetics.

Lots of potential here for getting students thinking about life cycles and gender that go beyond genetics and collaborating with each other. I've also been to several interesting workshops related to Second Life and I will post more on those later.

Thursday, February 26, 2009

Caminalcules II: Mother and her pups

Continuing along with my Caminalcule genetics activity...

Here is a heterozygous Caminalcule mother with 10 of her pups produced by selfing under incomplete dominance. The maternal script produces two gametes at random, the "pup" is rezzed and the genotype along with the degree of dominance communicated to the pup and the pup then changes phenotype.

This is of course not the way it works in the real world; the pups should be rezzed with the genotype in place but there doesn't seem to be an easy way to do that save maybe with some really clever use of llSetPrimativeParams. But my approach seems more flexible.


Here notice that roughly half the "pups" have the heterozygote's phenotype (grey) and roughly half are one of the two phenotypes (black or white) of the homozygotes.

Right now I represent a gene's locus with an SL vector type. The third position is not currently used but it could be used to store some other type of float type information related to the gene say something about its linkage position along a chromosome.

Coming up soon...Caminalcules make nookie.


Wednesday, February 25, 2009

Caminalcules I

I could work on photosynthesis forever, but must move on to get another project started. One thing I have wanted is a creature that might serve as the basis for several different modules. So I whipped together these cute (OK I think they are cute) sculpties. What I had in mind was something like Joe Camin's famous Caminalcules, fanciful, but useful as a teaching tool.

If you are not familiar with Caminalcules here is a pretty good discussion of these little critters. My guys look more like ground beetles than the original Caminalcule but I think they will do for now. I wanted to keep them fairly small and yet large enough to see and manipulate. The blue rod in the picture is an SL meter, so these are pretty small. Any smaller and the scultpie's little legs don't show well. Besides this is a good size for students to manipulate in Second Life.

My first project with these guys is going to be real simple: Mendelian monohybrid and dihybrid crosses followed by linkage. But these guys could easily be used for natural selection or ecology and I have put together a little interface for selecting the sorts of crosses you might want to do, concentrating on monohybrid crosses. Students will be able to self them(they have the potential of being hermaphroditic) or cross them with another one.

Right now there are four color forms: white, grey and black controlled at a single locus with incomplete dominance, though I can adjust the level of dominance. The 4th color form is bright red and that is displayed when one senses a compatible mate. I knew there was a use for sensor functions somewhere!

They will have litters of up to 10 pups at a time. Not to worry- the pups will be genetically modified to be sterile so they won't overrun a region!

Now to write the genetics states and functions I need. Once this is done then I will add more colors and textures controlled by different loci and allow for mutation so there will be plenty of variation for natural selection. I may introduce some genetically based behaviors as well.

Tuesday, February 17, 2009

Photosynthesis Engine V....more nitty gritty...

Well the sensor approach outlined last time had some problems. The entire light reaction model has 18 prims. Sensors are limited to the 16 prims closest to the sensor. When the model was running, some of the parts were not conststantly sensing where they needed to go.

So this meant a rework using linked prims and learning about how to get linked prims to communicate.




The big issue was my protons which are rezzed at various times. The problem is that when they are rezzed, they are unlinked prims and so can't communicate with the rest of the model using the link communication functions.

The strategy that worked was to first rezz a proton, then have the linked prim that rezzed the proton get the keys for the required places the protons need to go to and sending that information to the newly rezzed prim using llWhisper functions and listen events in the proton. I was concerned that the proton's listen events might not pick up all the Whispers, but that doesn't seem to be an issue.

The model runs much more smoothly as well!

So come on over and visit at:
http://slurl.com/secondlife/Carmine/118/143/296

Still trying to decide the best way to present the Calvin cycle....and working on some other other goodies. I will also be commenting on the Stepping into Science workshop I attended In World last Friday.