plotChordDiagram: plotChordDiagram Generate a chord diagram from a flowReMix...

Description Usage Arguments Details Examples

Description

plotChordDiagram Generate a chord diagram from a flowReMix fit.

Usage

1
2
3
4
5
6
7
8
plotChordDiagram(x, threshold = 0.6, varnames = c("stim", "parent",
  "functions"), separator = "/", function.separator = "\\+",
  track.order = c("functions", "parent", "stim"),
  sort.order = c("functions", "parent", "stim"), inner.track = "parent",
  track.height = 2, track.margin = c(0, 0), functions.name = "functions",
  wrap.at = c("\\+", "", ""), label.cex = c(0.5, 0.5, 0.5),
  facing = "clockwise", parsefun = NULL, functionality.filter = NULL,
  auc.filter = NULL, auc.outcome = NULL, response.filter = NULL)

Arguments

x

flowReMix fit

threshold

numeric threshold for the minimum edge weight in the graph (exclusive).

varnames

character variable names to define by splitting subsets. e.g. c("parent","stim","function")

separator

character separator to split subset string into variables.

function.separator

character separator to split multifunction string into individual functions.

track.order

character vector of the same length as varnames specifying the order of the variables in the tracks.

sort.order

character vector of the same length as varnames specifying the order of the variables in the tracks.

inner.track

character specifying which variable in varnames is on the inner track.

track.height

numeric vector of track heights, length 1 or length(varnames)

track.margin

numeric vector of length 2 specifying the track margin.

functions.name

character length 1, name of the column holding the functions.

wrap.at

character regex, string position to wrap labels for all tracks.

label.cex

numeric scaling factors for the labels in each track.Should be same length as varnames.

facing

character passed to circos.text. facing=c("inside", "outside", "reverse.clockwise", "clockwise", "downward", "bending", "bending.inside", "bending.outside")

parsefun

function that parses multiple function labels to single function matrix.

functionality.filter

numeric lower threshold for functionality degree. Exclusive.

auc.filter

numeric lower threshold for AUC prediction. Exclusive.

auc.outcome

name unquoted variable name used for prediction to calculate the AUC.

response.filter

numeric minimum cell subset response probability to include.

Details

Parses the subsets labels into factors that can be used to annotate tracks on a chord diagram. Connections correspond to edges in the ising stability graph with a minumum threshold propensity. A label such as "env/8+/IL2+" with an argument of separator="/" and varnames=c("stim","parent","functions") would cause the cell subset label to be parsed into three variables corresponding to the stimulation, the parent cell population, and the cytokine function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
data(fit505)
#also defined in the package namespace
parser = function(x,separator,functions){
  functions=enquo(functions)
   dat = x%>% mutate(func = strsplit(!!functions, split = separator)) %>%
  unnest()%>%tidyr::spread(func,func)
 dat[is.na(dat)]=""
 dat
}
plotChordDiagram(fit505,
   threshold = 0.8,
   varnames=c("stim","parent","functions"),
   track.order = c("stim","parent","functions"),
   sort.order=c("parent","stim","degree"),
   functions.name="functions",
   track.height = 2.5,
   track.margin = c(0,0),
   label.cex=0.6,
   wrap.at = " ",
   functionality.filter=1,
   auc.filter = 0,
   auc.outcome = hiv,
   response.filter = 0.05,
   facing=c("inside","inside","inside"),parsefun=parser)
   ## Not run: 
   plotChordDiagram(
     rv144_aggregate,
     threshold = 0.8,
     varnames = c("functions"),
     separator = " ",
     function.separator = ",",
     track.order = "functions",
     sort.order = c("degree", "functions"),
     inner.track = "functions",
     parsefun = parser,
     track.height = 2,
     track.margin = c(0, 0),
     functions.name = c("functions"),
     facing = "inside",
     wrap.at = " ",
     label.cex = 0.6,
     functionality.filter=1
)
   
## End(Not run)

RGLab/flowReMix documentation built on May 8, 2019, 5:55 a.m.