Skip to content

Localization Part 4

Renske van Raaphorst edited this page Mar 31, 2020 · 7 revisions

Plotting the localization

Now it’s time to project the global spot localization. We can do this relatively quickly using the function createPlotList(). This function can:

  1. combine spot and mesh data - if that is not already done before - and creates a spots_relative dataset with the relative spot localization

  2. plot the relative localization over cell width, length and both

  3. group the cells into n groups and plot cell projections and localization histograms of each group.

There are a lot of extra options in this function, of which I will show a few below. Check the full documentation here.

Localization plots of the origin of replication in B. subtilis

In figure 3 of our preprint, we plotted the projections of the localization of the origin of replication in 5 groups based on cell length. Below this, we plotted a demograph of the spot localizations on the length axis of the cell, ordered by cell length. Both plots are outputs of createPlotlist().

For this tutorial, I took the B. subtilis dataset as an example. You can of course do exactly the same with the S. aureus or S. pneumoniae dataset!

When you run createPlotlist(), you will get back a list of plots and datasets. Therefore, it is the easiest and least time-consuming to assign the output of createPlotlist() to a variable so you can access all plots easily after running the function:

plots_Bacillus <- createPlotList(spotdata=spots_Bacillus$spotframe,
                                 meshdata=mesh_Bacillus$mesh,
                                 groups=5
)

When running, you probably saw in the console that the function asks you if you want to see the plots - so you can quickly browse through your output. When you’re done, you can still access and view your plots:

You can access any member of a list by using the $-operator:

plots_Bacillus$lengthplot

The qplots and histograms are a bit special: they are plots grouped together. To see them in your Rstudio, just use the command plot():

plot(plots_Bacillus$qplots)

Except for qplots, createPlotList() also returns qplots_separate: these are the same plots, but then saved separately in a list of plots. This is useful if you would like to modify your plots afterwards, as you will see in the next section. Have a look at the createPlotList() documentation to see al the different outputs of the PlotList.


⬅️ Localization part 3: Checking Segmentation Localization part 5: Customize Plots ➡️
Clone this wiki locally