extr_MicrobeJ - veeninglab/BactMAP GitHub Wiki
upload MicrobeJ output into R for further analysis
Description
Upload the output of MicrobeJ into R. Upto now the code supports fluorescent localization data & cell outlines, both saved as seperate .CSV or .TXT files in the MicrobeJ GUI by first pressing -> expand all on one of the Results columns and then pressing -> export for both the cell contour dataset and the fluorescent localization dataset.
Warning
This function only works properly with certain features enabled in the MicrobeJ setup!
- For cell outlines, make sure to select
shape descriptors/contour
in yourBacteria detection
tab in MicrobeJ. If you detect chains or clumps then also selectshape descriptors/contour
in the options within. - Similarly, if you want to select objects (maxima/filaments), also select
shape descriptors/contour
there.
To export the datasets as CSV's, make sure you select the contour tabs if you want to have information on the cell outlines or object outlines:
Note that the contour files do not automatically contain the information on fluorescence intensity inside the cell. If you want to add this, or any other cell-specific features, you can add those using the option for adding columns on top of the results table. Below is an example for a column I called "intensity":
Usage
extr_MicrobeJ(dataloc,
spotloc,
objectloc,
mag = "No_PixelCorrection",
sepspot = ",",
sepmesh = ",",
sepob = ",",
cellList = FALSE,
keeprealvalues = FALSE,
magcor = c("dataloc", "spotloc", "objectloc"))
Arguments
-
dataloc: path of the exported microbeJ comma-seperated file (.csv or .txt) containing the outlines of the bacterial cells (the contour tab).
-
spotloc: path of the exported microbeJ comma-seperated file (.csv or .txt) containing the sub-directory with fluorescent spot coordinates
-
objectloc: path of the exported object contours.
-
mag: the pixel conversion factor to be used (see addPixels2um)
-
sepspot: default is ",". when the to-be-imported .csv/txt is seperated by another value, change here.
-
sepmesh: default is ",". when the to-be-imported .csv/txt is seperated by another value, change here.
-
sepobj: default is ",". when the to-be-imported .csv/txt is seperated by another value, change here.
-
cellList: when cellList==TRUE, the dataframe 'cellList' (see **Values **below) will be in the output list.
-
keeprealvalues: BactMAP detects whether it is likely that the maxima and contour coordinates are in different units (pixels and micron, for instance). If BactMAP detects this, it corrects it automatically and gives out a warning. You can override this behavior by setting keeprealvalues = TRUE.
-
magcor: In case you disabled the automatic magnification detection by setting keeprealvalues = TRUE, you can use magcor instead. Here, you can specify which datasets need to be corrected from pixels to micron. Default is set to all of them in a vector ( c("dataloc", "spotloc", "objectloc")). If you only want to correct the cell contours, set magcor to "dataloc", if you want to correct maxima and contours, set magcor to c("dataloc", "spotloc"). BactMAP will only correct the datasets specified and leave the rest.
Details
Input either dataloc, spotloc, objectloc or all to receive a list of dataframes containing the microbeJ data.
Use getPixels2um()
and addPixels2um()
to check which conversion factors are loaded and to add new ones.
Value
List of items containing:
-
$mesh: dataframe containing MicrobeJ outlines of the cell
-
$spotframe: dataframe containing MicrobeJ spot x/y coordinates and cell identifying number.
-
$spots_relative: dataframe containing the relative x/y coordinates of the spots inside the cell
-
$cellList: (a list of) the original input dataframe(s)
-
$pixels2um: the pixel conversion factor used in the function
References
Ducret, A., Quardokus, E.M. and Brun, Y.V., 2016. MicrobeJ, a tool for high throughput bacterial cell detection and quantitative analysis. Nature microbiology, 1, p.16077.
Examples
##upload MicrobeJ datasets
dataloc <- file.choose()
spotloc <- file.choose()
##extract data
micdata <- extr.MicrobeJ(dataloc, spotloc, mag = "100x_FRAP")
Back to Overview of Import Functions