Plotting Temporal Localization part 3 - veeninglab/BactMAP GitHub Wiki
Before making the figure, I need to pick out a single cell. For this, I start my making kymographs of all cells in my dataset. Since this is quite a short time-lapse of 60 minutes, I don’t expect many full divisions. The pneumococcus divides every 40 minutes in the experimental conditions, and since I’m imaging every 20 seconds, I’ll have to be careful, because the division time may slow down a bit towards the end of the movie due to phototoxicity. On top of all of this, cell tracking is quite tricky when the cells are close to each other, so even of the fully dividing cells available I might only catch a few.
Since I’m most interested in the DnaX localization, I’ll make Kymographs of DnaX.
First, I’ll connect the image pixel values from my dataset
DNAX
to the cell outlines in myMesh
using
extr_OriginalCells()
:
myCells_DnaX <- extr_OriginalCells(DNAX, myMesh)
Now I have a dataset where the pixel values, cell shape and orientation of the cells are combined, I can make my Kymographs.
bactKymo()
is a versatile function for kymographs and demographs. Check the documentation for all options. In this case, I settimeD
(time dimension) toTRUE
andsizeAV
toTRUE
to make time-based, single cell kymographs reflecting the increase in cell size as well as their internal fluorescence. I setmag
to the right value again, so the results are displayed in micron.
allKymosDnaX <- bactKymo(myCells_DnaX$rawdata_turned, timeD=TRUE, sizeAV =TRUE, mag="100x_DVMolgen")
To view my kymographs, I like to save them as a PDF. The function
cairo_pdf()
is useful when you want to save multiple plots in one file:
cairo_pdf(filename="myKymosDnaX.PDF", onefile=TRUE, width=5, height=4)
allKymosDnaX
dev.off()
Browsing through the the PDF of the kymographs, there’s a few things which come to mind:
- Most kymographs don’t show a full division: most cells are caught halfway, just because the movie is not long enough.
- Some cells don’t grow throughout the whole movie - especially the cells which appear “later” in the movie (higher cell number) have trouble growing. This is probably due to phototoxicity.
- Even with 1) and 2) in mind, a few cells are followed nicely and could serve as a cool example to plot localization in single cells.
To be sure of their health, I pick only “young” cells and continue with cells 3, 4, 5, 6, 7, 8 & 9.
To save some memory I’ll start with only keeping these kymographs. I can
select these ones by
subsetting
my kymograph list
allKymosDnaX
:
allKymosDnaX <- allKymosDnaX[c("cell3" ,"cell4", "cell5", "cell6", "cell7", "cell8", "cell9")]
Now, I also want to have the kymographs for the FtsZ channel. First,
I’ll connect the image data to the mesh data again using
extr_OriginalCells()
, then I use bactKymo()
to make my kymographs.
Since the
extr_OriginalCells()
andbactKymo()
functions are a bit slow, I subset the data already now by subsetting mymyMesh
dataframe
- that will save some computing time. Here I use
%in%
to select only that part ofmyMesh
wherecell
is equal to one of the members of the vectorc(3,4,5,6,7,8,9)
.
myCells_FtsZ <- extr_OriginalCells(FTSZ, myMesh[myMesh$cell%in%c(3,4,5,6,7,8,9),])
allKymosFtsZ <- bactKymo(myCells_FtsZ$rawdata_turned, timeD=TRUE, sizeAV=TRUE, mag="100x_DVMolgen")
Have a look at these kymographs, either by saving them again as a PDF,
or by just viewing them in the Rstudio plot window (type the name of the
kymo list, allKymosFtsZ
in the console to do this).
Looking at these kymographs, I decided to delete cell 3 because it seems like there has been a shift in segmentation somewhere between frame 50 and 75. Cell 9 shows a strange FtsZ phenotype - no new septa are formed. All the others look good to me. For the figure, I decided to move on with cell 4, but it could have been either of the others.
In figure 5-A, I displayed the kymographs from top-bottom instead of from
left-right. That is easy to do with the command coord_flip()
from
ggplot2
combined with
scale_x_reverse()
:
allKymosDnaX$cell4 + ggplot2::scale_x_reverse() + ggplot2::coord_flip()
Then, I’d like the FtsZ kymograph to have a different color, so I’ll
change the color scale
to
“magma” from
viridis
:
allKymosFtsZ$cell4 + ggplot2::scale_x_reverse() + ggplot2::coord_flip() + ggplot2::scale_fill_viridis_c(option="magma")
⬅️ Plotting Temporal Localization Part 2: Data Import | Plotting Temporal Localization Part 4: Making Cell Towers ➡️ |
---|