Switch to unified view

a b/man/summary_plot_rwr_attributes.Rd
1
% Generated by roxygen2: do not edit by hand
2
% Please edit documentation in R/plot.R
3
\name{summary_plot_rwr_attributes}
4
\alias{summary_plot_rwr_attributes}
5
\title{Summary Plot RWR attributes}
6
\usage{
7
summary_plot_rwr_attributes(
8
  X,
9
  color = NULL,
10
  seed.id = NULL,
11
  seed.type = NULL,
12
  plot = TRUE
13
)
14
}
15
\arguments{
16
\item{X}{a 'rwr.attributes' or 'list.rwr.attributes' object
17
from rwr_find_seeds_between_attributes()}
18
19
\item{color}{(optional) a named character vector or list,
20
list of color to apply to each type}
21
22
\item{seed.id}{(optional) a character vector, to filter the results and
23
filter on specific seeds IDs}
24
25
\item{seed.type}{(optional) a character vector, to filter the results and
26
filter on specific seeds types}
27
28
\item{plot}{logical, if TRUE then the plot is produced}
29
}
30
\value{
31
a 'ggplot' object
32
}
33
\description{
34
Based on the results of
35
\code{\link[netOmics]{rwr_find_seeds_between_attributes}} which identify the
36
closest k neighbors from a seed, this function returns a barplot of the node
37
types (layers) reached for each seed.
38
}
39
\examples{
40
graph1 <- igraph::graph_from_data_frame(
41
    list(from = c("A", "B", "A", "D", "C", "A", "C"), 
42
         to = c("B", "C", "D", "E", "D", "F", "G")), 
43
    directed = FALSE)
44
graph1 <- igraph::set_vertex_attr(graph = graph1, 
45
                                  name = 'type', 
46
                                  index = c("A","B","C"),
47
                                  value = "1")
48
graph1 <- igraph::set_vertex_attr(graph = graph1,
49
                                  name = 'type', 
50
                                  index = c("D","E"),
51
                                  value = "2")
52
graph1 <- igraph::set_vertex_attr(graph = graph1,
53
                                  name = 'type', 
54
                                  index = c("F", "G"),
55
                                  value = "3")
56
57
rwr_res <- random_walk_restart(X = graph1, 
58
                               seed = c("A", "B", "C", "D", "E"))
59
rwr_res_type <- rwr_find_seeds_between_attributes(X = rwr_res, 
60
                                                  attribute = "type",
61
                                                  k = 3)
62
summary_plot_rwr_attributes(rwr_res_type)
63
64
65
}
66
\seealso{
67
\code{\link[netOmics]{random_walk_restart}},
68
\code{\link[netOmics]{rwr_find_seeds_between_attributes}}
69
}