### #66Gradient Sensing-I 梯度感應_一

/*----------Divider----------*/
It's imperative for creatures to sense the gradient of nutrients and poisonous stuffs. The suggested reading we are going to talk about in recent episodes is about how Dictyostelium discoideum, a slime mold, sense the gradient of nutrients. For completeness, we will first discuss the chemotaxis of E. coli in this episode, which most of you may have learned it in your high school or freshman biology courses.

/*----------Divider----------*/

Let's recall how E. coli senses the concentration gradient. E. coli possess 2 motility modes: the "run" mode and the "tumbling" mode. The bacteria run fast and near linearly during the "run" mode while simply changing their direction during the "tumbling" mode. The frequency of tumbling depends on the background concentration of the nutrients. It tumbles less if the concentration of nutrients is high.

The figure came from the blog of Scientific American. Link：http://blogs.scientificamerican.com/oscillator/files/2011/10/chemotaxis.jpg

The genetic circuit underlying the chemotaxis of bacteria is an interesting topics, but it is not we are going to talk about today. We are always told that using such mechanism, bacteria could successfully migrate toward places with more nutrients. However, no one has ever really demonstrated its success to me. So today we are going to write a simple code to simulate the chemotaxis of bacteria, and check whether such mechanism works.

We write the following codes in MATLAB:

size = 3000;

base = rand(size,size);

area = round(base + grad + grad');

t_obs = 200000; dir_all = {[1,1], [1, 0], [1, -1], [0, 1], [0, -1], [-1, 1], [-1, 0], [-1,-1]};

v = 5; size_Ecoli = 1;

nEcoli = 50;

Ecoli_cell = cell(nEcoli,1);

Ecoli_dir = cell(nEcoli, 1);

for n = 1:nEcoli

xy_series = zeros(t_obs,2); x0 = size/2; y0 = size/2; xy_series(1,:)=[x0, y0]; t_series = zeros(t_obs,1);

dir_series = zeros(t_obs,2); dir = dir_all{randi(8)};  dir_series(1,:) = dir;

for t = 1:1:t_obs

if xy_series(t,1) < (size-size_Ecoli) && xy_series(t,2) < (size-size_Ecoli) && xy_series(t,1) > size_Ecoli && xy_series(t,2) > size_Ecoli

t_series(t) = sum(sum(area(xy_series(t,1)-size_Ecoli:xy_series(t,1)+size_Ecoli, xy_series(t,2)-size_Ecoli:xy_series(t,2)+size_Ecoli)));

if t>1

del_sum = t_series(t) - t_series(t-1);

dir_change = round(rand(1,1) - del_sum/(2*size_Ecoli));

if dir_change >=1

dir = dir_all{randi(8)};

end

end

xy_series(t+1,:) = xy_series(t,:) + v*dir;

dir_series(t,:) = dir;

end

end

Ecoli_cell{n} = xy_series;

Ecoli_dir{n} = dir_series;

end

dir_total = zeros(1,nEcoli);

figure, imshow(area); hold on;

for n = 1:nEcoli

xy_series = Ecoli_cell{n};

dir_series = Ecoli_dir{n};

Max = round(nnz(xy_series)/2);

sum_dir = sum(dir_series(:))/(sqrt(2)*Max);

dir_total(n) = sum_dir;

xy_series = Ecoli_cell{n};

plot(xy_series(1:Max,1), xy_series(1:Max,2), 'LineWidth', 2);

end

display(mean(dir_total));

In the codes above, we created a background gradient looks like this. The brighter the site, the more nutrients there are.

And we have 50 bacteria on it. Their probability of tumbling would increase if they find that there are less nutrients in its surroundings. They compare the concentration of nutrients every τ seconds. Meanwhile we display the average chemotactic index, or CI of these 50 bacteria. The chemotactic index is defined as

The θi is the angle between the direction of bacterial velocity and the direction of actual gradient.

Now let's look at their trajectories. Although there are only 8 different colors, the followings actually represents the results from 50 different "artificial" bacteria.

It looks just "okay" at the first glance. However, the only objective criteria for the performance of chemotaxis is the chemotactic index. So what is the CI for the above result? --- 0.0126. It means that our bacteria waste most of their time tumbling around and did not move along the direction of gradient, even though they eventually move towards the correct side.

Of course we may try to adjust the above code to make the performance better. If only the bacteria could detect the nutrients in larger area, which should increase the S/N ratio of nutrients detection and gradient sensing. We therefore adjust size_Ecoli from 1 to 3, and the result looks like this:

Hmm, it DOES look much better. However, the CI of the above figure is only 0.0309, as terrible as before.

After a little trial and error, it's time to calm down and think carefully about what determines the CI. To answer the question, we drew a schematic diagram like this:

Assume that the bacteria is at location r(t) with speed v(t) and speed direction. The number of nutrients it could detect now is ρ(r(t))*A. After time τ, the bacteria now moves to r(t+τ)=r(t)+v*τ*(cosθ0, sinθ0), and the number of nutrients it could detect now is [ρ(r(t))+ρ‧vτ]*A. That is to say, the expectation value of the difference in number of detected nutrients after time τ is ρ‧vτA.

And now let's think about the probability of tumbling. We first assume that it equals p = p(Δn). There are only 2 possibilities:
(1)The bacterium tumbles:
There is a p chance to have cosθi = ρ/|ρ|‧(cosθ', sinθ')
(2)The bacterium does not tumble:
There is a (1-p) chance to have cosθi = ρ/|ρ|‧v/|v|
It's obvious that the average of ρ/|ρ|‧(cosθ', sinθ') = 0 since (cosθ', sinθ') is randomly determined. So to have larger CI, it's necessary to keep the background probability of tumbling a small enough value. That is to say, instead of having a p=p(Δn) which has a functionality looks like the left one, it would be much more preferable if p=p(Δn) has a functionality looks like the right one:

(1)有轉彎：機率p→cosθi = ρ/|ρ|‧(cosθ', sinθ')
(2)沒有轉彎：機率1-p cosθi = ρ/|ρ|‧v/|v|

Besides, because the coverage range by a bacterium is quite small. Even though there is no background gradient, the number of nutrients detected in such small area would follows binomial distribution (or Poisson distribution if the nutrients is scarce enough). It would be beneficial to move farther away from the previous site before it to decide whether to tumble or not, since the difference in detected nutrients would be more likely to come from concentration gradient rather than the background noise.

So we adjust our codes as follow:

size = 3000;
base = rand(size,size);

area = round(base + grad + grad');

t_obs = 100000; dir_all = {[1,1], [1, 0], [1, -1], [0, 1], [0, -1], [-1, 1], [-1, 0], [-1,-1]};

v = 80; size_Ecoli = 3;

nEcoli = 50;

Ecoli_cell = cell(nEcoli,1);
Ecoli_dir = cell(nEcoli, 1);
for n = 1:nEcoli
xy_series = zeros(t_obs,2); x0 = size/2; y0 = size/2; xy_series(1,:)=[x0, y0]; t_series = zeros(t_obs,1);
dir_series = zeros(t_obs,2); dir = dir_all{randi(8)};  dir_series(1,:) = dir;
for t = 1:1:t_obs
if xy_series(t,1) < (size-size_Ecoli) && xy_series(t,2) < (size-size_Ecoli) && xy_series(t,1) > size_Ecoli && xy_series(t,2) > size_Ecoli
t_series(t) = sum(sum(area(xy_series(t,1)-size_Ecoli:xy_series(t,1)+size_Ecoli, xy_series(t,2)-size_Ecoli:xy_series(t,2)+size_Ecoli)));
if t>1
del_sum = t_series(t) - t_series(t-1);
dir_change = round(rand(1,1) - 0.49 - 80*del_sum/(2*size_Ecoli+1)^2);
if dir_change >=1
dir = dir_all{randi(8)};
end
end
xy_series(t+1,:) = xy_series(t,:) + v*dir;
dir_series(t,:) = dir;
end
end
Ecoli_cell{n} = xy_series;
Ecoli_dir{n} = dir_series;
end
dir_total_v5s1 = zeros(1,nEcoli);
figure, imshow(area); hold on;
for n = 1:nEcoli
xy_series = Ecoli_cell{n};
dir_series = Ecoli_dir{n};
Max = round(nnz(xy_series)/2);
sum_dir = sum(dir_series(:))/(sqrt(2)*Max);
dir_total_v5s1(n) = sum_dir;
xy_series = Ecoli_cell{n};
plot(xy_series(1:Max,1), xy_series(1:Max,2), 'LineWidth', 2);
end
display(mean(dir_total_v5s1));

And it looks like this:跑跑看結果囉~：

The performance become much better since the CI become 0.3435. In the real world, the distance between tumbling of E. coli is approximately 10 times of its body length.  Besides, it is possible to accomplish chemotaxis by adjusting the probability of tumbling with respect to the amount of detected nutrients or repellents. However, it is not the mechanism utilized by slime mold. Would you like to figure it out? Stay tuned and we'll see you next time!
chemotaxis的情況看起來是差不多，但CI值就跳到0.3435囉！而在真實的情況中，大腸桿菌轉彎與轉彎之間間隔的距離，大約是他體長的10倍，而藉由改變轉彎機率的方式，也的確能達成chemotaxis的效果。不過在下一集我們要介紹的黏菌，可就不是透過這樣的機制了喔！我們下次再來看看吧~~！
/*----------Divider----------*/