R/class-Cerebro_v1.3.R
Cerebro_v1.3.Rd
A Cerebro_v1.3
object is an R6 class that contains several types of
data that can be visualized in Cerebro.
A new Cerebro_v1.3
object.
version
cerebroApp version that was used to create the object.
experiment
list
that contains meta data about the data set,
including experiment name, species, date of export.
technical_info
list
that contains technical information
about the analysis, including the R session info.
parameters
list
that contains important parameters that
were used during the analysis, e.g. cut-off values for cell filtering.
groups
list
that contains specified grouping variables and
and the group levels (subgroups) that belong to each of them. For each
grouping variable, a corresponding column with the same name must exist
in the meta data.
cell_cycle
vector
that contains the name of columns in the
meta data that contain cell cycle assignments.
gene_lists
list
that contains gene lists, e.g.
mitochondrial and/or ribosomal genes.
expression
matrix
-like object that holds transcript counts.
meta_data
data.frame
that contains cell meta data.
projections
list
that contains projections/dimensional
reductions.
most_expressed_genes
list
that contains a data.frame
holding the most expressed genes for each grouping variable that was
specified during the call to getMostExpressedGenes
.
marker_genes
list
that contains a list
for every
method that was used to calculate marker genes, and a data.frame
for each grouping variable, e.g. those that were specified during the
call to getMarkerGenes
.
enriched_pathways
list
that contains a list
for
every method that was used to calculate marker genes, and a
data.frame
for each grouping variable, e.g. those that were
specified during the call to getEnrichedPathways
or
performGeneSetEnrichmentAnalysis
.
trees
list
that contains a phylogenetic tree (class
phylo
) for grouping variables.
trajectories
list
that contains a list
for every
method that was used to calculate trajectories, and, depending on the
method, a data.frame
or list
for each specific trajectory,
e.g. those extracted with extractMonocleTrajectory
.
extra_material
list
that can contain additional material
related to the data set; tables should be stored in data.frame
format in a named list
called `tables`
new()
Create a new Cerebro_v1.3
object.
Cerebro_v1.3$new()
A new Cerebro_v1.3
object.
setVersion()
Set the version of cerebroApp
that was used to generate this
object.
Cerebro_v1.3$setVersion(version)
version
Version to set.
getVersion()
Get the version of cerebroApp
that was used to generate this
object.
Cerebro_v1.3$getVersion()
Version as package_version
class.
checkIfGroupExists()
Safety function that will check if a provided group name is present in
the groups
field.
Cerebro_v1.3$checkIfGroupExists(group_name)
group_name
Group name to be tested
checkIfColumnExistsInMetadata()
Safety function that will check if a provided group name is present in the meta data.
Cerebro_v1.3$checkIfColumnExistsInMetadata(group_name)
group_name
Group name to be tested.
addExperiment()
Add information to experiment
field.
Cerebro_v1.3$addExperiment(field, content)
field
Name of the information, e.g. organism
.
content
Actual information, e.g. hg
.
getExperiment()
Retrieve information from experiment
field.
Cerebro_v1.3$getExperiment()
list
of all entries in the experiment
field.
addParameters()
Add information to parameters
field.
Cerebro_v1.3$addParameters(field, content)
field
Name of the information, e.g. number_of_PCs
.
content
Actual information, e.g. 30
.
getParameters()
Retrieve information from parameters
field.
Cerebro_v1.3$getParameters()
list
of all entries in the parameters
field.
addTechnicalInfo()
Add information to technical_info
field.
Cerebro_v1.3$addTechnicalInfo(field, content)
field
Name of the information, e.g. R
.
content
Actual information, e.g. 4.0.2
.
getTechnicalInfo()
Retrieve information from technical_info
field.
Cerebro_v1.3$getTechnicalInfo()
list
of all entries in the technical_info
field.
addGroup()
Add group to the groups registered in the groups
field.
Cerebro_v1.3$addGroup(group_name, levels)
group_name
Group name.
levels
vector
of group levels (subgroups).
getGroups()
Retrieve all names in the groups
field.
Cerebro_v1.3$getGroups()
vector
of registered groups.
getGroupLevels()
Retrieve group levels for a group registered in the groups
field.
Cerebro_v1.3$getGroupLevels(group_name)
group_name
Group name for which to retrieve group levels.
vector
of group levels.
setMetaData()
Set meta data for cells.
Cerebro_v1.3$setMetaData(table)
table
data.frame
that contains meta data for cells. The
number of rows must be equal to the number of rows of projections and
the number of columns in the transcript count matrix.
getMetaData()
Retrieve meta data for cells.
Cerebro_v1.3$getMetaData()
data.frame
containing meta data.
addGeneList()
Add a gene list to the gene_lists
.
Cerebro_v1.3$addGeneList(name, genes)
name
Name of the gene list.
genes
vector
of genes.
getGeneLists()
Retrieve gene lists from the gene_lists
.
Cerebro_v1.3$getGeneLists()
list
of all entries in the gene_lists
field.
setExpression()
Set transcript count matrix.
Cerebro_v1.3$setExpression(counts)
counts
matrix
-like object that contains transcript counts
for cells in the data set. Number of columns must be equal to the number
of rows in the meta_data
field.
getCellNames()
Get names of all cells.
Cerebro_v1.3$getCellNames()
vector
containing all cell names/barcodes.
getGeneNames()
Get names of all genes in transcript count matrix.
Cerebro_v1.3$getGeneNames()
vector
containing all gene names in transcript count matrix.
getMeanExpressionForGenes()
Retrieve mean expression across all cells in the data set for a set of genes.
Cerebro_v1.3$getMeanExpressionForGenes(genes)
genes
Names of genes to extract; no default.
data.frame
containing specified gene names and their respective
mean expression across all cells in the data set.
getMeanExpressionForCells()
Retrieve (mean) expression for a single gene or a set of genes for a given set of cells.
Cerebro_v1.3$getMeanExpressionForCells(cells = NULL, genes = NULL)
cells
Names/barcodes of cells to extract; defaults to NULL
,
which will return all cells.
genes
Names of genes to extract; defaults to NULL
, which
will return all genes.
vector
containing (mean) expression across all specified genes in
each specified cell.
getExpressionMatrix()
Retrieve transcript count matrix.
Cerebro_v1.3$getExpressionMatrix(cells = NULL, genes = NULL)
cells
Names/barcodes of cells to extract; defaults to NULL
,
which will return all cells.
genes
Names of genes to extract; defaults to NULL
, which
will return all genes.
Dense transcript count matrix for specified cells and genes.
setCellCycle()
Add columns containing cell cycle assignments to the cell_cycle
field.
Cerebro_v1.3$setCellCycle(cols)
cols
vector
of columns names containing cell cycle
assignments.
getCellCycle()
Retrieve column names containing cell cycle assignments.
Cerebro_v1.3$getCellCycle()
vector
of column names in meta data.
addProjection()
Add projections (dimensional reductions).
Cerebro_v1.3$addProjection(name, projection)
name
Name of the projection.
projection
data.frame
containing positions of cells in
projection.
availableProjections()
Get list of available projections (dimensional reductions).
Cerebro_v1.3$availableProjections()
vector
of projections / dimensional reductions that are available.
getProjection()
Retrieve data for a specific projection.
Cerebro_v1.3$getProjection(name)
name
Name of projection.
data.frame
containing the positions of cells in the projection.
addTree()
Add phylogenetic tree to trees
field.
Cerebro_v1.3$addTree(group_name, tree)
group_name
Group name that this tree belongs to.
tree
Phylogenetic tree as phylo
object.
getTree()
Retrieve phylogenetic tree for a specific group.
Cerebro_v1.3$getTree(group_name)
group_name
Group name for which to retrieve phylogenetic tree.
Phylogenetic tree as phylo
object.
addMostExpressedGenes()
Add table of most expressed genes.
Cerebro_v1.3$addMostExpressedGenes(group_name, table)
group_name
Name of grouping variable that the most expressed genes
belong to. Must be registered in the groups
field.
table
data.frame
that contains the most expressed genes.
getGroupsWithMostExpressedGenes()
Retrieve names of grouping variables for which most expressed genes are available.
Cerebro_v1.3$getGroupsWithMostExpressedGenes()
vector
of grouping variables for which most expressed genes are
available.
getMostExpressedGenes()
Retrieve table of most expressed genes for a grouping variable.
Cerebro_v1.3$getMostExpressedGenes(group_name)
group_name
Grouping variable for which most expressed genes should be retrieved.
data.frame
that contains most expressed genes for group levels of
the specified grouping variable.
addMarkerGenes()
Add table of marker genes.
Cerebro_v1.3$addMarkerGenes(method, name, table)
method
Name of method that was used to generate the marker genes.
name
Name of table. This name will be used to select the table in
Cerebro. It is recommended to use the grouping variable, e.g.
sample
.
table
data.frame
that contains the marker genes.
getMethodsForMarkerGenes()
Retrieve names of methods that were used to generate marker genes.
Cerebro_v1.3$getMethodsForMarkerGenes()
vector
of names of methods that were used to generate marker
genes.
getGroupsWithMarkerGenes()
Retrieve grouping variables for which marker genes were generated using a specified method.
Cerebro_v1.3$getGroupsWithMarkerGenes(method)
method
Name of method.
vector
of grouping variables for which marker genes were
calculated using the specified method.
getMarkerGenes()
Retrieve table of marker genes for specific method and grouping variable.
Cerebro_v1.3$getMarkerGenes(method, name)
method
Name of method.
name
Name of table.
data.frame
that contains marker genes for the specified
combination of method and grouping variable.
addEnrichedPathways()
Add table of enriched pathways.
Cerebro_v1.3$addEnrichedPathways(method, name, table)
method
Name of method that was used to generate the enriched pathways.
name
Name of table. This name will be used to select the table in
Cerebro. It is recommended to use the grouping variable, e.g.
sample
.
table
data.frame
that contains the enriched pathways.
getMethodsForEnrichedPathways()
Retrieve names of methods that were used to generate enriched pathways.
Cerebro_v1.3$getMethodsForEnrichedPathways()
vector
of names of methods that were used to generate enriched
pathways.
getGroupsWithEnrichedPathways()
Retrieve grouping variables for which enriched pathways were generated using a specified method.
Cerebro_v1.3$getGroupsWithEnrichedPathways(method)
method
Name of method.
vector
of grouping variables for which enriched pathways were
calculated using the specified method.
getEnrichedPathways()
Retrieve table of enriched pathways for specific method and grouping variable.
Cerebro_v1.3$getEnrichedPathways(method, name)
method
Name of method.
name
Grouping variable.
data.frame
that contains enriched pathways for the specified
combination of method and grouping variable.
addTrajectory()
Add trajectory.
Cerebro_v1.3$addTrajectory(method, name, content)
method
Name of method that was used to generate the trajectory.
name
Name of the trajectory. This name will be used later in Cerebro to select the trajectory.
content
Relevant data for the trajectory, depending on the method
this could be a list
holding edges, cell positions, pseudotime,
etc.
getMethodsForTrajectories()
Retrieve names of methods that were used to generate trajectories.
Cerebro_v1.3$getMethodsForTrajectories()
vector
of names of methods that were used to generate
trajectories.
getNamesOfTrajectories()
Retrieve names of available trajectories for a specified method.
Cerebro_v1.3$getNamesOfTrajectories(method)
method
Name of method.
vector
of available trajectory for the specified method.
getTrajectory()
Retrieve data for a specific trajectory.
Cerebro_v1.3$getTrajectory(method, name)
method
Name of method.
name
Name of trajectory.
The type of data depends on the method that was used to generate the trajectory.
addExtraMaterial()
Add content to extra material field.
Cerebro_v1.3$addExtraMaterial(category, name, content)
category
Name of category. At the moment, only tables
and
plots
are valid categories. Tables must be in data.frame
format and plots must be created with ggplot2
.
name
Name of material, will be used to select it in Cerebro.
content
Data that should be added.
addExtraTable()
Add table to `extra_material` slot.
Cerebro_v1.3$addExtraTable(name, table)
name
Name of material, will be used to select it in Cerebro.
table
Table that should be added, must be data.frame
.
addExtraPlot()
Add plot to `extra_material` slot.
Cerebro_v1.3$addExtraPlot(name, plot)
name
Name of material, will be used to select it in Cerebro.
plot
Plot that should be added, must be created with
ggplot2
(class: ggplot
).
getExtraMaterialCategories()
Get names of categories for which extra material is available.
Cerebro_v1.3$getExtraMaterialCategories()
vector
with names of available categories.
checkForExtraTables()
Check whether there are tables in the extra materials.
Cerebro_v1.3$checkForExtraTables()
logical
indicating whether there are tables in the extra
materials.
getNamesOfExtraTables()
Get names of tables in extra materials.
Cerebro_v1.3$getNamesOfExtraTables()
vector
containing names of tables in extra materials.
getExtraTable()
Get table from extra materials.
Cerebro_v1.3$getExtraTable(name)
name
Name of table.
Requested table in data.frame
format.
checkForExtraPlots()
Check whether there are plots in the extra materials.
Cerebro_v1.3$checkForExtraPlots()
logical
indicating whether there are plots in the extra
materials.
getNamesOfExtraPlots()
Get names of plots in extra materials.
Cerebro_v1.3$getNamesOfExtraPlots()
vector
containing names of plots in extra materials.
getExtraPlot()
Get plot from extra materials.
Cerebro_v1.3$getExtraPlot(name)
name
Name of plot.
Requested plot made with ggplot2
.
print()
Show overview of object and the data it contains.
Print overview of available marker gene results for self$print()
function.
Print overview of available enriched pathway results for
self$print()
function.
Print overview of available trajectories for self$print()
function.
Print overview of extra material for self$print()
function.
Cerebro_v1.3$print()
clone()
The objects of this class are cloneable with this method.
Cerebro_v1.3$clone(deep = FALSE)
deep
Whether to make a deep clone.