-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-experiment-analysis.qmd
2064 lines (1940 loc) · 72.8 KB
/
02-experiment-analysis.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Experiment analysis {#sec-experiment-analysis}
```{r}
#| label: find-preprocessing-files-02-experiment-analysis
experiment_analysis_files <- fs::dir_ls(
path = here::here("data-preprocessing", "02-experiment-analysis"),
type = "file",
glob = "*qmd"
)
```
```{r child=experiment_analysis_files}
#| label: execute-preprocessing-files-02-experiment-analysis
```
```{r clear-environment}
rm(list = ls())
```
```{r}
#| label: libraries
library(tidyverse)
library(tidymodels)
library(tidytext)
library(plotly)
library(ggpubr)
library(GGally)
library(ggdist)
library(embed)
library(here)
library(fs)
library(patchwork)
```
```{r}
#| label: read-processed-data
cells_file <- here("data", "processed", "cells_summary.csv")
cells_raw_df <- read_csv(
file = cells_file,
show_col_types = FALSE
) %>%
select(-over_ds_red_id) %>%
rename(divided = divided_id)
```
```{r}
#| label: create-factors
cells_df <- cells_raw_df %>%
mutate(
filamented_id = factor(
x = filamented_id,
levels = c(FALSE, TRUE),
labels = c("Not filamented", "Filamented")
),
survived = factor(
x = survived,
levels = c(FALSE, TRUE),
labels = c("Not survived", "Survived")
),
cell_status = interaction(
filamented_id,
survived,
sep = " - "
),
cell_status = paste0(
filamented_id,
" - ",
survived
),
cell_status = factor(cell_status)
) %>%
relocate(where(is.character), where(is.factor), where(is.logical))
```
```{r}
#| label: population-read-data
#| results: hide
#|
lineages_file <- here("data", "processed", "lineages.csv")
lineages_raw_df <- read_csv(
file = lineages_file,
show_col_types = FALSE
) %>%
glimpse()
```
```{r}
#| label: population-create-factors
#| results: hide
#|
lineages_processed_1_df <- lineages_raw_df %>%
mutate(
filamented_id = factor(
x = filamented_id,
levels = c(FALSE, TRUE),
labels = c("Not filamented", "Filamented")
),
filamented_at_time = factor(
x = filamented_at_time,
levels = c(FALSE, TRUE),
labels = c("Not filamented", "Filamented")
),
survived = factor(
x = survived,
levels = c(FALSE, TRUE),
labels = c("Not survived", "Survived")
),
cell_status = interaction(
filamented_id,
survived,
sep = " - "
) %>%
as.character() %>%
as.factor()
) %>%
glimpse()
```
```{r}
#| label: set-default-plot-style
theme_set(
theme_bw() +
theme(
legend.position = "top",
strip.background = element_blank(),
panel.grid = element_blank()
)
)
cell_status_pallete <- list(
"Filamented - Not survived" = "#dd5129",
"Filamented - Survived" = "#0f7ba2",
"Not filamented - Survived" = "#43b284",
"Not filamented - Not survived"= "#fab255"
)
cell_status_legend_order <- c(
"Not filamented - Survived",
"Not filamented - Not survived",
"Filamented - Survived",
"Filamented - Not survived"
)
```
```{r}
#| label: utility-functions
parse_metrics_column <- function(.data, metric_column) {
.data %>%
mutate(
{{ metric_column }} := str_remove(
string = {{ metric_column }},
pattern = "(.+)_"
) %>%
factor(
levels = c("first", "sos", "last"),
labels = c("Initial", "SOS", "End")
) %>%
identity()
)
}
```
## Introduction
The previous chapter (see @sec-image-processing) detailed the steps
necessary to extract data from a set of microfluidic images through
image analysis techniques and fluorescence microscopy. Each step was
instrumental in creating a dataset that was easy to explore and ask
questions. With the help of computational biology, systems biology, and
data analysis techniques, we could process these files to help us in the
search to find the role of filamentation in cell survival.
Computational biology and systems biology contributed to the development
of this analysis. In principle, computational biology originated after
the origin of computer science with the British mathematician and
logistician Alan Turing (regularly known as the father of computing)
[@turing1950]. Over time, systems biology emerged as an area that
synergistically combines models and experimental data to understand
biological processes [@bruggeman]. Thus, giving a step towards creating
models that, in general, are phenomenological but sometimes serve to
discover new ideas about the process under study. Without the computer's
power, modern ideas and aspects of studying biological sciences would
otherwise be unthinkable.
Here, we divide the experimental analysis into two main parts: 1) at the
cell level or measurements at specific points in time and 2) at the
population level and time series. The first level allowed us to identify
the individual contribution of each variable understudy to determine
cell survival. The second level allowed us to understand how the
population behaves according to the passage of time in the face of
exposure to a harmful agent (in this case, beta-lactam antibiotics).
Together, both visions of the same study phenomenon allowed us to
extract the main ideas for postulating a mathematical model that seeks
to show how filamentation is a factor for cell survival in stressful
environments (see @sec-model-analysis).
## General preprocessing of data {#sec-experiment-general-preprocessing}
The raw data processing consisted mainly of creating two levels of
observation for the cells of both chromosomal strains and multicopy
plasmids. The first level is at a cell granularity, point properties.
The second level consists of the cells over time, thus observing
properties at the population level. We did this because it would allow
us to understand what factors affect filamentation and why.
We normalized the fluorescence values of DsRed and GFP for both
experiments based on the values observed before antibiotic exposure. It
allowed us to have a basis to work with and compare expressions between
cells. In the case of DsRed environment drug concentration, we also
applied a logarithmic transformation to observe subtle changes in
fluorescence intensity that would allow us to detect cell death.
Ultimately, we decided to classify cells into four fundamental groups
based on whether the cell filamented and survived (see
@fig-cell-distribution-across-experiments). We define a *filamented
cell* as a cell with more than two standard deviations from the mean
concerning the lengths observed before introducing antibiotics into the
system. On the other hand, although there are multiple ways to define
death from single-cell observations [@trevors2012; @kroemer2008], we
considered a *cell dead or missing* when we stopped having information
about it, either because of fluorescence in the red channel was above a
given threshold (resulting from an increase in cell membrane
permeability and the introduction of fluorescent dye into the cell) or
because it left the field of observation. Therefore, we defined a
*surviving cell* as a cell observed before and after antibiotic exposure
that did not surpass the DsRed death threshold.
```{r}
#| label: fig-cell-distribution-across-experiments
#| fig-scap: Cell classification and its distribution across experiments.
#| fig-cap: >
#| **Cell classification and its distribution across experiments.**
#| We define a *filamented cell* as a cell whose length exceeded two standard
#| deviations from the mean at any time during the experiment. A *surviving cell*
#| is a cell we observed before and after exposure to the antibiotic and did not
#| surpass the DsRed death threshold. Accordingly, we removed from the analysis
#| those cells that died before or were born after antibiotic exposure.
#| Therefore, we delimited the effect caused by antibiotic exposure.
#|
p_cells_distribution <- cells_df %>%
count(experiment_id, cell_status) %>%
group_by(experiment_id) %>%
mutate(
percentage = n / sum(n) * 100,
ymax = cumsum(percentage),
ymin = c(0, head(ymax, -1)),
labels = paste0(format(percentage, digits = 2), "%"),
labels_position = (ymax + ymin) / 2,
total_label = paste0("Total:\n", format(sum(n), big.mark = ","), " cells")
) %>%
ungroup() %>%
identity() %>%
ggplot(
aes(
ymin = ymin,
ymax = ymax,
xmin = 3,
xmax = 4
)
) +
geom_rect(
size = 1.5,
color = "white",
aes(fill = cell_status)
) +
geom_label(
x = 2,
aes(
y = labels_position,
label = labels
),
label.size = NA,
size = 3.5,
) +
geom_text(
aes(x = -Inf, y = -Inf, label = total_label),
hjust = 0.5,
vjust = 0.5
) +
facet_grid(. ~ experiment_id) +
coord_polar(theta = "y") +
xlim(c(-1, 4)) +
guides(
fill = guide_legend(ncol = 2)
) +
theme_void() +
theme(
legend.position = "bottom"
) +
labs(
fill = "Cell status"
) +
scale_fill_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
NULL
p_cells_distribution
```
## Results
### Cell length and the amount of GFP are crucial in determining cell survival {#sec-length-gfp-crucial}
We evaluated the DsRed, GFP, and length values for each cell at
different time points: initial, filamentation, and end. This
preprocessing allowed us to observe and quantify each cell at critical
times in the experiment and eliminate noise or signals outside the scope
of this investigation.
We define the *initial time* as the first time we observed the cell in
the experiment. *Filamentation time* equals when a cell reaches the
filamentation threshold (see @fig-length-temporal-distribution) for the
first time. We defined the *end time* as the time of the last
observation of the cell. We decided to bound the end time for surviving
cells to one frame (10 min) after the end of antibiotic exposure so that
the observed signal would reflect the final stress responses.
When we compared the distributions of DsRed, GFP, and length for both
experiments, we observed the changes in their role in cell survival. In
@fig-dsred-temporal-distribution, we show that indistinctly and, as
expected, surviving cells managed to eliminate the antibiotic by the end
time. In contrast, dead cells presented higher levels of antibiotics
(measured by proxy through the mean DsRed intensity of the cell).
```{r}
#| label: fig-dsred-temporal-distribution
#| fig-scap: DsRed temporal distribution.
#| fig-cap: >
#| **DsRed temporal distribution.**
#| To evaluate the incident effect of the antibiotic marked by DsRed
#| on cells by class, we show its values at three key moments: start,
#| filamentation (SOS), and end. The upper asterisks represent the
#| significance value when comparing a group X to the filamented and
#| surviving cell reference. Asterisks in a line indicate whether or not
#| there is a significant difference in the survival of non-filamented cells.
#| Dots represent the mean of each group. The line bars represents the
#| distribution of the data. Although, at the initial time, we observe
#| multiple significant differences, this is likely due to the intrinsic
#| noise of the system since, as expected, the values are close to zero.
#| We observed a difference between the surviving and non-filamented
#| cells for the chromosomal strain for the SOS time, but the same did not
#| occur for the plasmid strain. The final amount of DsRed makes a clear
#| difference between survival and death.
#|
p_temporal_dsred_distributution <- cells_df %>%
pivot_longer(
cols = contains("ds_red"),
names_to = "metric",
values_to = "value"
) %>%
parse_metrics_column(metric) %>%
filter(!is.na(value)) %>%
identity() %>%
ggplot(aes(x = cell_status, y = value, fill = cell_status, color = cell_status)) +
stat_eye() +
stat_compare_means(
method = "t.test",
comparisons = list(c("Not filamented - Survived", "Not filamented - Not survived")),
label = "p.signif",
label.y = c(0.4),
hide.ns = TRUE
) +
stat_compare_means(
method = "anova",
label.x.npc = 0.10,
label.y.npc = 0.93
) + # Add global annova p-value
stat_compare_means(
label = "p.signif",
method = "t.test",
ref.group = "Filamented - Survived",
hide.ns = TRUE,
label.y.npc = 0.80
) +
facet_grid(experiment_id ~ metric) +
guides(
color = guide_legend(ncol = 2),
fill = guide_legend(ncol = 2)
) +
theme(
axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank(),
panel.grid = element_blank()
) +
labs(
fill = "Cell status",
color = "Cell status",
y = "DsRed value"
) +
scale_fill_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
scale_color_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
NULL
p_temporal_dsred_distributution
```
On the other hand, GFP observations in @fig-gfp-temporal-distribution
showed us that filamented cells had low fluorescent intensities (low
plasmid copy-number) at the beginning of the experiment. In comparison,
the chromosomal strain did not exhibit noticeable changes in GFP levels.
For the final observation times, GFP measurements indicated that among
the cells that did not filament, the ones that survived exhibited a
reduced GFP expression concerning cells killed by the antibiotic.
Meanwhile, for the filamented cells, whether surviving or dead, their
GFP measurements indicated no difference at the beginning or the end of
the experiment, suggesting the presence of other determinants of cell
survival.
```{r}
#| label: fig-gfp-temporal-distribution
#| fig-scap: GFP temporal distribution.
#| fig-cap: >
#| **GFP temporal distribution.**
#| To evaluate the incident effect of the GFP on cells by class, we used
#| the same notation as in @fig-dsred-temporal-distribution.
#| The chromosomal strain exhibits variability in GFP at different
#| time points, mainly due to experimental noise resulting from low
#| fluorescent intensity values. As expected, filamented cells had
#| a lower initial GFP in the plasmid strain.
#| At the time of filamentation, there appear to be differences in
#| fluorescence between surviving and dead cells. However, in the end time,
#| we observed that the surviving non-filamented cells have lower GFP
#| values than the non-filamented dead cells and alive filamented cells.
#|
p_temporal_gfp_distributution <- cells_df %>%
pivot_longer(
cols = contains("gfp"),
names_to = "metric",
values_to = "value"
) %>%
parse_metrics_column(metric) %>%
filter(!is.na(value)) %>%
identity() %>%
ggplot(aes(x = cell_status, y = value, fill = cell_status, color = cell_status)) +
stat_eye() +
stat_compare_means(
method = "t.test",
comparisons = list(c("Not filamented - Survived", "Not filamented - Not survived")),
label = "p.signif",
label.y = c(2.0),
hide.ns = TRUE
) +
stat_compare_means(
method = "anova",
label.x.npc = 0.10,
label.y.npc = 0.93
) + # Add global annova p-value
stat_compare_means(
label = "p.signif",
method = "t.test",
ref.group = "Filamented - Survived",
hide.ns = TRUE,
label.y.npc = 0.75
) +
facet_grid(experiment_id ~ metric) +
guides(
color = guide_legend(ncol = 2),
fill = guide_legend(ncol = 2)
) +
theme(
axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank(),
panel.grid = element_blank()
) +
labs(
fill = "Cell status",
color = "Cell status",
y = "GFP value"
) +
scale_fill_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
scale_color_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
NULL
p_temporal_gfp_distributution
```
Cell length was one of the factors that GFP expression levels could not
explain for cell survival. In @fig-length-temporal-distribution, we show
that the conclusions regarding filamentation were applicable for both
chromosomal and plasmid strains. For the initial times, filamented and
survived cells were shorter in length than those that died but longer
than not filamented cells of both classes, while non-filamented cells
did not differ. We observed no length differences between cells at
filamentation time. Thus, survival could depend on other factors, such
as growth rate. In the final time, the results were well-defined.
Surviving cells had a greater length than their non-surviving pair
(*i.e.*, dead filamented and non-filamented cells). However, for
filamented cells, surviving cells generally represent a distribution of
higher final length values but are not as extensive as their dead
counterpart. Which we could explain as a length limit to which cells can
grow without dying. Nevertheless, we had no information to evaluate such
a hypothesis.
```{r}
#| label: fig-length-temporal-distribution
#| fig-scap: Length temporal distribution.
#| fig-cap: >
#| **Length temporal distribution.**
#| To evaluate the incident effect of length on cells by class,
#| we use the same notation as in @fig-dsred-temporal-distribution.
#| The observations for both strains, chromosomal or plasmid, are the same.
#| In the beginning, the surviving filamented cells already have a difference
#| in length from the rest of the classes. At the time of
#| filamentation, there is no difference to help determine whether the
#| cell will survive or not. Finally, in the final time, it seems that
#| the surviving filamented cells have a greater length than the rest
#| of the groups. However, this length is moderate compared to the excess
#| length shown by non-surviving filamented cells. On the other hand,
#| we highlighted the growth of the surviving non-filamented cells.
#| Therefore, although they did not reach a length for us to classify as
#| filamented, the cells did resort to filamentation.
#|
p_temporal_length_distributution <- cells_df %>%
pivot_longer(
cols = contains("length"),
names_to = "metric",
values_to = "value"
) %>%
parse_metrics_column(metric) %>%
filter(!is.na(value)) %>%
identity() %>%
ggplot(aes(x = cell_status, y = value, fill = cell_status, color = cell_status)) +
geom_hline(aes(yintercept = filamentation_threshold), linetype = "dashed", alpha = 1 / 2) +
stat_eye() +
stat_compare_means(
method = "t.test",
comparisons = list(
c("Not filamented - Survived", "Not filamented - Not survived")
),
label = "p.signif",
label.y = c(60),
hide.ns = TRUE
) +
stat_compare_means(
method = "anova",
label.y.npc = 0.43,
label.x.npc = 0.3
) + # Add global annova p-value
stat_compare_means(
label = "p.signif",
method = "t.test",
ref.group = "Filamented - Survived",
hide.ns = TRUE,
label.y.npc = 0.3
) +
facet_grid(experiment_id ~ metric) +
coord_cartesian(ylim = c(0, 150)) +
guides(
color = guide_legend(ncol = 2),
fill = guide_legend(ncol = 2)
) +
theme(
axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank(),
panel.grid = element_blank()
) +
labs(
fill = "Cell status",
color = "Cell status",
y = "Length value"
) +
scale_fill_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
scale_color_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
NULL
p_temporal_length_distributution
```
Once we observed the effects of GFP expression levels and lengths in
determining whether a cell lives or dies, we projected the cells onto
the plane. We painted them with their class status (See
@fig-cell-distribution-across-experiments) to determine whether these
two variables contained the necessary information to cluster the data
correctly. In @fig-just-initial-values, we show the initial GFP and
length values projection. While, with some work, we could contextually
place the results in @fig-gfp-temporal-distribution and
@fig-length-temporal-distribution, the initial values did not appear to
determine the classes. Therefore, we explored the final versus initial
values differences in @fig-metric-differences. With this new
representation of the cells in the plane, we contextualized the
statistical results presented in @fig-gfp-temporal-distribution and
@fig-length-temporal-distribution. Besides, it showed us that
differences in length (*i.e.*, filamentation) and reductions in GFP
expression are essential in determining cell survival. Though the
clustering of cell status is not entirely separated, other variables
affect the experimental results in cell survival.
```{r}
#| label: fig-just-initial-values
#| fig-scap: Experiment's initial values.
#| fig-cap: >
#| **Experiment's initial values.**
#| By positioning a cell in space based on its initial length and GFP
#| values, we can see that class separation occurs, but not as a strong
#| signal. Therefore, we concluded that although the initial state
#| influences the result, this is not everything. For this, we have
#| the example of the length changes throughout the experiment caused
#| by filamentation. In this graph, the GFP scale is at log10 to help
#| us observe those minor differences between the experiments.
#|
p_initial_values <- cells_df %>%
ggplot(aes(x = log(gfp_first), y = length_first, color = cell_status)) +
geom_point(alpha = 1/2, size = 0.5) +
facet_wrap(. ~ experiment_id, scales = "free") +
guides(
color = guide_legend(ncol = 2, override.aes = list(alpha = 1, size = 1)),
fill = guide_legend(ncol = 2)
) +
labs(
x = "Initial normalized GFP (log10)",
y = "Initial length",
color = "Cell status"
) +
scale_fill_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
scale_color_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
NULL
p_initial_values
```
```{r}
#| label: fig-metric-differences
#| fig-scap: Experiment's initial values differences.
#| fig-cap: >
#| **Experiment's initial values differences.**
#| By comparing the metric differences of the last observation and
#| the first observation of a cell, we can separate mainly the
#| surviving filamented cells from those that did not do it in both
#| experiments (blue dots). Meanwhile, cells with plasmids form a
#| small accumulation of surviving cells that did not produce
#| filament (green dots). However, this has made a breakthrough in
#| understanding what is affecting cell survival. There are still
#| variables that we can include to understand this phenomenon better.
#|
p_metric_differences <- cells_df %>%
ggplot(aes(x = log(gfp_last) - log(gfp_first), y = length_last - length_first, color = cell_status)) +
geom_point(alpha = 1/2, size = 0.5) +
facet_grid(~experiment_id) +
guides(
color = guide_legend(ncol = 2, override.aes = list(alpha = 1)),
fill = guide_legend(ncol = 2)
) +
labs(
x = "End GFP - Initial GFP",
y = "End length - Initial length",
color = "Cell status"
) +
scale_fill_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
scale_color_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
NULL
p_metric_differences
```
```{r}
#| include: false
#| label: fig-histogram-gpf-intensity
#| fig-scap: Histograms of fluorescent intensity for classified cells.
#| fig-cap: >
#| **Histograms of fluorescent intensity for classified cells.**
#| A) Cells in MG:GT exhibit a fluorescent distribution with low variance
#| and with no significant differences in mean GFP between cells that
#| produced filaments and were killed (red) or survived (blue), as well
#| as for cells that did not produce filaments and died (orange), and those
#| that survived drug exposure (green). B) GFP distributions of the
#| plasmid-bearing population exhibit large variance. Cells that
#| survived showed increased mean fluorescence relative to cells that were
#| killed. For surviving cells, mean GFP was significantly lower for cells
#| that did not produce filaments with respect to cells that triggered the
#| SOS response system.
#|
cells_df |>
ggplot(aes(
x = gfp_first,
y = ..scaled..,
color = cell_status,
fill = cell_status
)) +
geom_density(
alpha = 1 / 4,
) +
facet_grid(experiment_id ~ .) +
scale_x_continuous(
expand = c(0, 0)
) +
scale_y_continuous(
expand = c(0, 0),
labels = scales::label_percent()
) +
guides(
color = guide_legend(ncol = 2),
fill = guide_legend(ncol = 2)
) +
theme(
legend.position = "top",
panel.spacing = unit(1, "lines")
) +
labs(
x = "GFP",
y = "Scaled density",
color = "Cell status",
fill = "Cell status"
) +
scale_fill_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
scale_color_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
NULL
```
### Number of divisions and cell age do not appear to play a clear role in determining cell survival
In @sec-length-gfp-crucial, we explored the effect on cell survival
through GFP variability and cell length.However,
@fig-just-initial-values and @fig-metric-differences showed us the
possibility of other factors relevant to the phenomenon under study. As
some papers in the literature suggest, some of these other factors may
be cell division and chronological age (*i.e.*, how much time has passed
since the last cell division at the time of exposure to a toxic agent)
[@moger-reischer2019; @roostalu2008; @heinrich2015]. Therefore, we chose
to observe these two metrics in experiments at a purely qualitative
level, i.e., without the inclusion of, e.g., metrics of membrane or cell
cycle properties [@Joseleau-Petit1999].
Although we expected to see a small contribution, either by the number
of divisions or cell age, in @fig-number-divisions and
@fig-time-since-last-division, we could not observe a precise effect of
these variables on cell survival. Although they could have an
explanation or biological significance, we decided to omit as relevant
in the characterization of our cells, since the signal was not clear.
However, we derived from this analysis a slightly simpler variable that
tells us whether a cell underwent a cell division event or not. So it
gives us a more generalized picture of the contribution of division to
cell survival (see @fig-plasmid-pca-variable-contribution).
```{r}
#| label: fig-number-divisions
#| fig-scap: Cell's number of divisions.
#| fig-cap: >
#| **Cell's number of divisions.**
#| Both chromosomal and plasmid cells exhibited a wider distribution of
#| divisions for the surviving cells against non-surviving cells. However,
#| we did not appreciate a significant change between the chromosome
#| filamented cells. Therefore, the number of cell divisions' contribution
#| to filamentation remains uncertain.
#| echo: false
lineages_processed_1_df |>
filter(
time <= antibiotic_start_time
) |>
count(experiment_id, id, cell_status, wt = division) |>
ggplot(aes(
x = cell_status,
y = n,
fill = cell_status
)) +
stat_eye() +
stat_compare_means(
label = "p.signif",
method = "t.test",
ref.group = "Filamented - Survived",
label.y.npc = 0.75,
hide.ns = TRUE
) +
stat_compare_means(
method = "t.test",
comparisons = list(c("Not filamented - Survived", "Not filamented - Not survived")),
label = "p.signif",
label.y.npc = 0.6,
hide.ns = TRUE
) +
facet_grid(. ~ experiment_id) +
guides(
fill = guide_legend(ncol = 2)
) +
theme(
panel.grid.major = element_blank(),
axis.text.x = element_blank(),
axis.title.x = element_blank(),
axis.ticks.x = element_blank(),
panel.grid = element_line(colour = "grey92"),
panel.grid.minor = element_line(size = rel(0.5))
) +
scale_fill_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
scale_y_continuous(
breaks = 0:6
) +
labs(
y = "Number of divisions",
fill = "Cell status"
) +
NULL
```
```{r}
#| label: fig-time-since-last-division
#| fig-scap: Time elapsed since the last division at the beginning of the experiment.
#| fig-cap: >
#| **Time elapsed since the last division at the beginning of the experiment.**
#| The mean time of the last division before starting the experiment
#| indicates that it did not influence the final result for chromosomal
#| cells. There is a slight difference between the filamented-not survived
#| cells and the rest for cells with plasmids. However, the signal does not
#| appear to be strong on the survival role. Therefore, we conclude that we
#| have no evidence to support that the time of the last division at the
#| beginning of the experiment influences the final classification results.
#|
p_time_since_last_division <- cells_df %>%
filter(!is.na(time_since_last_division_to_experiment_start)) %>%
ggplot(
aes(
x = cell_status,
y = time_since_last_division_to_experiment_start,
fill = cell_status
)
) +
stat_eye(position = "dodge") +
facet_grid(.~experiment_id) +
labs(
x = "Experiment",
y = "Time since last division to experiment start",
fill = "Cell status"
) +
guides(
color = guide_legend(ncol = 2),
fill = guide_legend(ncol = 2)
) +
theme(
axis.title.x = element_blank(),
axis.ticks.x = element_blank(),
axis.text.x = element_blank(),
panel.grid.major.x = element_blank(),
panel.grid = element_line(colour = "grey92"),
panel.grid.minor = element_line(size = rel(0.5))
) +
scale_fill_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
scale_color_manual(
values = cell_status_pallete,
breaks = cell_status_legend_order
) +
NULL
p_time_since_last_division
```
### Time to reach filamentation matters in determining cell survival
In @fig-dsred-temporal-distribution, @fig-gfp-temporal-distribution, and
@fig-length-temporal-distribution, we showed how, at the time of
filamentation, DsRed and GFP levels appeared indifferent to the cells.
Therefore, we hypothesized that a possible variable determining cell
survival could be its time to activate its anti-stress response system
that causes filamentation. Furthermore, we also guided our hypothesis by
previous reports showing us how the gene expression level can induce
filamentation with tight temporal coordination.
While, for our analyses, we did not measure the concentration of
antibiotic that triggers filamentation per se, we indirectly quantified
its effect by using the time it took for a cell to reach a length at
which it is already considered a filamentating cell. Furthermore, to
recognize that the observed effect was a product of the experiment, we
decided to keep only filamented cells just once antibiotic exposure
began.
@fig-time-to-filamentation-filtered shows how filamentation times are
narrower for chromosomal cells than for plasmid-bearing cells. Then, we
hypothesize that the effect could come from the heterogeneity in the
plasmid copy number in the population. Also, interestingly, we observed
that, for both experiments, cells that survived had longer filamentation
times than those that died. These differences in response times suggest
the following: 1) if the cell grows too fast, it will reach a limit and
start to accumulate antibiotics constantly, and 2) if the cell grows too
fast, likely, the cost of maintaining an ample length for prolonged
periods of exposure will become counterproductive.
```{r}
#| label: fig-time-to-filamentation-filtered
#| fig-scap: Time to filamentation filtered.
#| fig-cap: >
#| **Time to filamentation filtered.**
#| We only keep cells that filamented during the antibiotic exposure to
#| quantify their time to filamentation and its effect on survival.
#| In this way, we normalize the start times for the calculation of the
#| filamentation time. For both strains, the filamentation time had a more
#| significant delay in the surviving cells.
p_time_to_filamentation_filtered <- cells_df %>%
filter(
filamented_id == "Filamented",
time_sos > antibiotic_start_time
) %>%
mutate(
time_to_sos = time_sos - antibiotic_start_time,
) %>%
ggplot(aes( x = cell_status, y = time_to_sos, fill = survived)) +
stat_eye(position = "dodge") +
stat_compare_means(
label = "p.signif",
label.y.npc = 0.8,
comparisons = list(c("Filamented - Not survived", "Filamented - Survived"))
) +
facet_grid(. ~ experiment_id) +
labs(
x = "Experiment",
y = "Time to filamentation (minutes)",
fill = "Cell status"
) +
theme(
axis.title.x = element_blank(),
axis.ticks.x = element_blank(),
axis.text.x = element_blank(),
panel.grid.major.x = element_blank(),
panel.grid = element_line(colour = "grey92"),
panel.grid.minor = element_line(size = rel(0.5))
) +
scale_fill_manual(
values = c("#dd5129", "#43b284")
) +
NULL
p_time_to_filamentation_filtered
```
In Figure @fig-initial-values-with-time, we decided to project the
results of Figure @fig-time-to-filamentation-filtered in a space similar
to the one described in Figure @fig-just-initial-values). Thus, we
separated our data into cells that survived and cells that did not and
painted them when it took them to reach their filamented state. We
realized that, by adding this temporal component to the initial
variables of length and GFP, we could separate surviving cells from dead
cells to a greater degree. However, it may still not be enough, and
there are still many other variables that play a crucial role in
understanding the ecology of stress and how some cells will be survivors
or not.
```{r}
#| label: fig-initial-values-with-time
#| fig-scap: Experiment initial values with time to filamentation.
#| fig-cap: >
#| **Experiment initial values with time to filamentation.**
#| As in @fig-just-initial-values, including the time it will take for cells
#| to filament allows us to better understand the phenomenon of survival.
#| Cells that filamented and survived generally have a much higher delay
#| than their non-filamented peers for both strains
#| (see @fig-time-to-filamentation-filtered).
p_initial_values_with_time <- cells_df %>%
filter(
filamented_id == "Filamented",
time_sos > antibiotic_start_time
) %>%
mutate(time_to_sos = time_sos - antibiotic_start_time) %>%
ggplot(aes(x = length_first, y = log(gfp_first), z = time_to_sos, color = time_to_sos)) +
# stat_summary_2d() +
geom_point() +
facet_grid(experiment_id ~ survived) +
scale_color_viridis_c(option = "inferno") +