This package is designed to import/export the hierarchical gated
cytometry data to and from R (specifically the
openCyto framework) using the
gatingML2.0
and FCS3.0
cytometry data standards. This package makes use of the GatingSet R
object and data model so that imported data can easily be manipulated
and visualized in R using tools like
openCyto and
ggCyto.
Combine manual gating strategies with automated gating strategies in
R.
Export data gated manually, auto-gated, or gated using a combination
of manual and automated strategies from R to
Diva,
FlowJo and
Cytobank.
Share computational flow analyses with users on other platforms.
Perform comparative analyses between computational and manual gating
approaches.
Reporting Bugs or Issues
Use the issue template in github when creating a new issue.
Follow the instructions in the template (do your background reading).
Search and verify that the issue hasn’t already been addressed.
Check the Bioconductor support site.
Make sure your flow packages are up to date.
THEN if your issue persists, file a bug report.
Otherwise, we may close your issue without responding.
INSTALLATION
CytoML can be installed in several ways:
For all versions:
For all versions, you must have dependencies installed
library(BiocManager)
# This should pull all dependencies.
BiocManager::install("openCyto")
# Then install latest dependencies from github, using devtools.
install.packages("devtools")
library(devtools) #load it
install_github("RGLab/flowWorkspace")
install_github("RGLab/openCyto")
A reproducible workflow can be found at the RGLab
site, and was prepared with version
1.7.10 of CytoML, R v3.5.0, and dependencies that can be installed
by:
# We recomend using R version 3.5.0
devtools::install_github("RGLab/RProtoBufLib@v1.3.7")
devtools::install_github("RGLab/cytolib@v1.3.2")
devtools::install_github("RGLab/flowCore@v1.47.7")
devtools::install_github("RGLab/flowWorkspace@v3.29.7")
devtools::install_github("RGLab/openCyto@v1.19.2")
devtools::install_github("RGLab/CytoML@v1.7.10")
devtools::install_github("RGLab/ggcyto@v1.9.12")
Examples
Import data
To import data you need the xml workspace and the raw FCS files.
ws <- open_diva_xml(system.file('extdata/diva/PE_2.xml', package = "flowWorkspaceData"))
# The path to the FCS files is stored in ws@path.
# It can also be passed in to parseWorksapce via the `path` argument.
gs <- diva_to_gatingset(ws, name = 2, subset = 1, swap_cols = FALSE)
Interact with the gated data (GatingSet)
We need flowWorkspace to interact with the imported data.
library(flowWorkspace)
We can visualize the gating tree as follows:
#get the first sample
gh <- gs[[1]]
#plot the hierarchy tree
plot(gh)
The openCyto.count column shows the cell counts computed via the
import. The xml.count column shows the cell counts computed by FlowJo
(note not all platforms report cell counts in the workspace). It is
normal for these to differ by a few cells due to numerical differences
in the implementation of data transformations. CytoML and openCyto are
reproducing the data analysis from the raw data based on the
information in the workspace.
We can plot all the gates defined in the workspace.
#plot the gates
plotGate(gh)
Access information about cells in a specific population.
Because CytoML and flowWorkspace reproduce the entire analysis in a
workspace in R, we have access to information about which cells are part
of which cell popualtions.
flowWorkspace has convenience methods to extract the cells from specific
cell populations:
## Warning in gatingset_to_cytobank(gs, outFile): With
## 'cytobank.default.scale' set to 'TRUE', data and gates will be re-
## transformed with cytobank's default scaling settings, which may affect how
## gates look like.
## [1] "/tmp/RtmpV1ZasG/file4b9f7e4e25c1.xml"
CytoML: Cross-Platform Cytometry Data Sharing.
This package is designed to import/export the hierarchical gated cytometry data to and from R (specifically the openCyto framework) using the
gatingML2.0andFCS3.0cytometry data standards. This package makes use of theGatingSetR object and data model so that imported data can easily be manipulated and visualized in R using tools like openCyto and ggCyto.What problems does CytoML solve?
CytoML allows you to:
Reporting Bugs or Issues
Otherwise, we may close your issue without responding.
INSTALLATION
CytoML can be installed in several ways:
For all versions:
For all versions, you must have dependencies installed
Installing from BioConductor.
Installing from GitHub
Reproducible examples from the CytoML paper
Examples
Import data
To import data you need the xml workspace and the raw FCS files.
Import
gatingMLgenerated from Cytobank.Import a Diva workspace.
Interact with the gated data (
GatingSet)We need
flowWorkspaceto interact with the imported data.We can visualize the gating tree as follows:
For more information see the flowWorkspace package.
We can print all the cell populations defined in the gating tree.
We can extract the cell population statistics.
The
openCyto.countcolumn shows the cell counts computed via the import. Thexml.countcolumn shows the cell counts computed by FlowJo (note not all platforms report cell counts in the workspace). It is normal for these to differ by a few cells due to numerical differences in the implementation of data transformations. CytoML and openCyto are reproducing the data analysis from the raw data based on the information in the workspace.We can plot all the gates defined in the workspace.
Access information about cells in a specific population.
Because CytoML and flowWorkspace reproduce the entire analysis in a workspace in R, we have access to information about which cells are part of which cell popualtions.
flowWorkspace has convenience methods to extract the cells from specific cell populations:
This returns a
flowFramewith the cells in gate P3 (70% of the cells according to the plot).The matrix of expression can be extracted from a
flowFrameusing theexprs()method from theflowCorepackage:Export gated data to other platforms.
In order to export gated data, it must be in
GatingSetformat.Export a
GatingSetfrom R to Cytobank or FlowJoLoad something to export.
Export to Cytobank
Export to FlowJo
Next Steps
See the flowWorskspace and openCyto packages to learn more about what can be done with
GatingSetobjects.Code of conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.