View source: R/00_flowgraph_constructor.R
flowGraph | R Documentation |
Initializes a flowGraph
object given the cell counts
for one or more flow cytometry sample(s).
The flowGraph object returned holds meta data
for each sample, each cell population node,
edges representing how each cell population node relate to one another,
and features for these nodes and edges.
flowGraph(
input_,
meta = NULL,
class = "class",
no_cores = 1,
markers = NULL,
layout_fun = "layout.reingold.tilford",
max_layer = NULL,
cumsumpos = FALSE,
prop = TRUE,
specenr = TRUE,
path = NULL,
calculate_summary = TRUE,
node_features = "SpecEnr",
edge_features = "NONE",
test_name = "t_diminish",
test_custom = "t",
diminish = TRUE,
label1 = NULL,
label2 = NULL,
save_plots = FALSE
)
input_ |
Any of the following:
All input samples should have the same |
meta |
A data frame with meta data for each |
class |
A string corresponding to the column name or index
of |
no_cores |
An integer indicating how many cores to parallelize on. |
markers |
A string vector of marker names used in |
layout_fun |
A string of a function from the |
max_layer |
And integer indicating the maximum layer in the cell hierarchy to analyze; set to 'NULL' to analyze all layers. |
cumsumpos |
A logical variable indicating whether
or not to cumulate cell counts;
this applies only when |
prop |
A logical variable indicating whether or not to
calculate the proportion feature;
this can be done later on with |
specenr |
logical variable: whether or not to calculate the SpecEnr feature, Default: T |
path |
A string indicating the folder path to where the flowGraph object should save its elements, Default = NULL (don't save). |
calculate_summary |
A logical variable indicating whether or not to
calculate the summary statistics for SpecEnr based on default parameters
using the |
node_features |
A string vector indicating which node feature(s)
to perform summary statistics on; set to |
edge_features |
A string vector indicating which edge feature(s)
to perform summary statistics on; set to |
test_name |
A string with the name of the test you are performing. |
test_custom |
See |
diminish |
A logical variable; applicable if |
label1 |
A string indicating a class label in
|
label2 |
A string indicating a class label in
|
save_plots |
A logical indicating whether or not to save plots. |
flowGraph
is the constructor for the flowGraph
object.
The user can choose to input as input_
a vector, a Phenotypes
object (meaning there is only one sample), a matrix, or a Phenotypes
object list. If the user is also inputting a sample meta data frame, it
must contain a id
column corresponding to sample names.
flowGraph object
flowGraph-class
fg_get_feature
fg_get_feature_desc
fg_get_summary
fg_get_summary_desc
fg_add_feature
fg_rm_feature
fg_add_summary
fg_rm_summary
fg_gsub_markers
fg_gsub_ids
fg_merge_samples
fg_extract_samples
fg_extract_phenotypes
fg_merge
registerDoParallel
Matrix
no_cores <- 1
samplen <- 10
meta_file <- data.frame(
id=1:samplen,
class=append(rep("control", samplen/2), rep("exp", samplen/2)),
stringsAsFactors=FALSE
)
## using the constructor -----------------------
data(fg_data_pos30)
# input: vector of load-able Phenotypes paths
fg <- flowGraph(fg_data_pos30$count[1,], no_cores=no_cores)
# input: matrix + vector of class corresponding to samples
fg <- flowGraph(fg_data_pos30$count, class=fg_data_pos30$meta$class,
no_cores=no_cores)
# - save to file directly
# fg <- flowGraph(fg_data_pos30$count, class=fg_data_pos30$meta$class,
# no_cores=no_cores, path="path_to_folder)
# input: matrix + meta data frame
# fg <- flowGraph(fg_data_pos30$count, meta=fg_data_pos30$meta,
# no_cores=no_cores)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.