|
a |
|
b/man/enrich_circo_bar.Rd |
|
|
1 |
% Generated by roxygen2: do not edit by hand |
|
|
2 |
% Please edit documentation in R/EnrichCircoBar.R |
|
|
3 |
\name{enrich_circo_bar} |
|
|
4 |
\alias{enrich_circo_bar} |
|
|
5 |
\title{Combine and Visualize Data with Circular Bar Chart} |
|
|
6 |
\usage{ |
|
|
7 |
enrich_circo_bar(data_list) |
|
|
8 |
} |
|
|
9 |
\arguments{ |
|
|
10 |
\item{data_list}{A list of data frames to be combined.} |
|
|
11 |
} |
|
|
12 |
\value{ |
|
|
13 |
A `ggplot` object representing the Circular Bar Chart. |
|
|
14 |
} |
|
|
15 |
\description{ |
|
|
16 |
This function combines multiple data frames, arranges them, and visualizes the combined data |
|
|
17 |
in a Circular Bar Chart using the 'ggplot2' and 'ggalluvial' packages. |
|
|
18 |
} |
|
|
19 |
\examples{ |
|
|
20 |
# Create sample data frames for each enrichment category |
|
|
21 |
|
|
|
22 |
# 1. Biological Process (BP) |
|
|
23 |
filtered_data_BP <- data.frame( |
|
|
24 |
Description = c( |
|
|
25 |
"immune response", |
|
|
26 |
"cell proliferation", |
|
|
27 |
"signal transduction", |
|
|
28 |
"apoptotic process", |
|
|
29 |
"metabolic process" |
|
|
30 |
), |
|
|
31 |
Count = c(120, 85, 150, 60, 95), |
|
|
32 |
color = c( |
|
|
33 |
"#1f77b4", # blue |
|
|
34 |
"#ff7f0e", # orange |
|
|
35 |
"#2ca02c", # green |
|
|
36 |
"#d62728", # red |
|
|
37 |
"#9467bd" # purple |
|
|
38 |
), |
|
|
39 |
stringsAsFactors = FALSE |
|
|
40 |
) |
|
|
41 |
|
|
|
42 |
# 2. Cellular Component (CC) |
|
|
43 |
filtered_data_CC <- data.frame( |
|
|
44 |
Description = c( |
|
|
45 |
"nucleus", |
|
|
46 |
"cytoplasm", |
|
|
47 |
"membrane", |
|
|
48 |
"mitochondrion", |
|
|
49 |
"extracellular space" |
|
|
50 |
), |
|
|
51 |
Count = c(90, 110, 75, 65, 80), |
|
|
52 |
color = c( |
|
|
53 |
"#1f77b4", |
|
|
54 |
"#ff7f0e", |
|
|
55 |
"#2ca02c", |
|
|
56 |
"#d62728", |
|
|
57 |
"#9467bd" |
|
|
58 |
), |
|
|
59 |
stringsAsFactors = FALSE |
|
|
60 |
) |
|
|
61 |
|
|
|
62 |
# 3. Molecular Function (MF) |
|
|
63 |
filtered_data_MF <- data.frame( |
|
|
64 |
Description = c( |
|
|
65 |
"protein binding", |
|
|
66 |
"DNA binding", |
|
|
67 |
"enzyme activity", |
|
|
68 |
"transporter activity", |
|
|
69 |
"receptor activity" |
|
|
70 |
), |
|
|
71 |
Count = c(140, 130, 100, 70, 90), |
|
|
72 |
color = c( |
|
|
73 |
"#1f77b4", |
|
|
74 |
"#ff7f0e", |
|
|
75 |
"#2ca02c", |
|
|
76 |
"#d62728", |
|
|
77 |
"#9467bd" |
|
|
78 |
), |
|
|
79 |
stringsAsFactors = FALSE |
|
|
80 |
) |
|
|
81 |
|
|
|
82 |
# 4. Disease Ontology (DO) |
|
|
83 |
filtered_data_DO <- data.frame( |
|
|
84 |
Description = c( |
|
|
85 |
"cancer", |
|
|
86 |
"cardiovascular disease", |
|
|
87 |
"neurological disorder", |
|
|
88 |
"metabolic disease", |
|
|
89 |
"infectious disease" |
|
|
90 |
), |
|
|
91 |
Count = c(200, 150, 120, 90, 160), |
|
|
92 |
color = c( |
|
|
93 |
"#1f77b4", |
|
|
94 |
"#ff7f0e", |
|
|
95 |
"#2ca02c", |
|
|
96 |
"#d62728", |
|
|
97 |
"#9467bd" |
|
|
98 |
), |
|
|
99 |
stringsAsFactors = FALSE |
|
|
100 |
) |
|
|
101 |
|
|
|
102 |
# 5. Reactome Pathways |
|
|
103 |
filtered_data_Reactome <- data.frame( |
|
|
104 |
Description = c( |
|
|
105 |
"Cell Cycle", |
|
|
106 |
"Apoptosis", |
|
|
107 |
"DNA Repair", |
|
|
108 |
"Signal Transduction", |
|
|
109 |
"Metabolism of Proteins" |
|
|
110 |
), |
|
|
111 |
Count = c(110, 95, 80, 130, 85), |
|
|
112 |
color = c( |
|
|
113 |
"#1f77b4", |
|
|
114 |
"#ff7f0e", |
|
|
115 |
"#2ca02c", |
|
|
116 |
"#d62728", |
|
|
117 |
"#9467bd" |
|
|
118 |
), |
|
|
119 |
stringsAsFactors = FALSE |
|
|
120 |
) |
|
|
121 |
|
|
|
122 |
# 6. KEGG Pathways |
|
|
123 |
filtered_data_kegg <- data.frame( |
|
|
124 |
Description = c( |
|
|
125 |
"PI3K-Akt signaling pathway", |
|
|
126 |
"MAPK signaling pathway", |
|
|
127 |
"NF-kappa B signaling pathway", |
|
|
128 |
"JAK-STAT signaling pathway", |
|
|
129 |
"Toll-like receptor signaling pathway" |
|
|
130 |
), |
|
|
131 |
Count = c(175, 160, 145, 130, 155), |
|
|
132 |
color = c( |
|
|
133 |
"#1f77b4", |
|
|
134 |
"#ff7f0e", |
|
|
135 |
"#2ca02c", |
|
|
136 |
"#d62728", |
|
|
137 |
"#9467bd" |
|
|
138 |
), |
|
|
139 |
stringsAsFactors = FALSE |
|
|
140 |
) |
|
|
141 |
|
|
|
142 |
# Combine all filtered data frames into a list |
|
|
143 |
data_list <- list( |
|
|
144 |
BP = filtered_data_BP, |
|
|
145 |
CC = filtered_data_CC, |
|
|
146 |
MF = filtered_data_MF, |
|
|
147 |
DO = filtered_data_DO, |
|
|
148 |
Reactome = filtered_data_Reactome, |
|
|
149 |
KEGG = filtered_data_kegg |
|
|
150 |
) |
|
|
151 |
|
|
|
152 |
# Create the Circular Bar Chart |
|
|
153 |
combined_and_visualized_data <- enrich_circo_bar(data_list) |
|
|
154 |
|
|
|
155 |
} |