Title: | Visualization Tool for Genetic Reassortment |
---|---|
Description: | Provides useful functions for visualizing virus reassortment events. |
Authors: | Guangchuang Yu [aut, cre] |
Maintainer: | Guangchuang Yu <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.29.0 |
Built: | 2024-12-19 03:52:24 UTC |
Source: | https://github.com/bioc/seqcombo |
geom layer of genotype
geom_genotype( virus_info, v_color = "darkgreen", v_fill = "steelblue", v_shape = "ellipse", l_color = "black", asp = 1, g_height = 0.65, g_width = 0.65 )
geom_genotype( virus_info, v_color = "darkgreen", v_fill = "steelblue", v_shape = "ellipse", l_color = "black", asp = 1, g_height = 0.65, g_width = 0.65 )
virus_info |
virus information |
v_color |
the color of outer boundary of virus; can use expression (e.g. v_color=~Host) to color virus by specific variable |
v_fill |
the color to fill viruses; can use expression (e.g. v_fill=~Host) to fill virus by specific variable |
v_shape |
one of 'hexagon' or 'ellipse' |
l_color |
color of the lines that indicate genetic flow |
asp |
aspect ratio of the plotting device |
g_height |
height of regions to plot gene segments relative to the virus |
g_width |
width of gene segment relative to width of the virus (the hexagon) |
geom layer
Guangchuang Yu
library(tibble) library(ggplot2) n <- 8 virus_info <- tibble(id = 1:7, x = c(rep(1990, 4), rep(2000, 2), 2009), y = c(1,2,3,5, 1.5, 3, 4), segment_color = list(rep('purple', n), rep('red', n), rep('darkgreen', n), rep('lightgreen', n), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'red', 'purple', 'red', 'purple'), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'), c('darkgreen', 'lightgreen', 'lightgreen', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'))) ggplot() + geom_genotype(virus_info)
library(tibble) library(ggplot2) n <- 8 virus_info <- tibble(id = 1:7, x = c(rep(1990, 4), rep(2000, 2), 2009), y = c(1,2,3,5, 1.5, 3, 4), segment_color = list(rep('purple', n), rep('red', n), rep('darkgreen', n), rep('lightgreen', n), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'red', 'purple', 'red', 'purple'), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'), c('darkgreen', 'lightgreen', 'lightgreen', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'))) ggplot() + geom_genotype(virus_info)
geom layer for reassortment events
geom_hybrid( virus_info, flow_info, v_color = "darkgreen", v_fill = "steelblue", v_shape = "ellipse", l_color = "black", asp = 1, parse = FALSE, g_height = 0.65, g_width = 0.65, t_size = 3.88, t_color = "black" )
geom_hybrid( virus_info, flow_info, v_color = "darkgreen", v_fill = "steelblue", v_shape = "ellipse", l_color = "black", asp = 1, parse = FALSE, g_height = 0.65, g_width = 0.65, t_size = 3.88, t_color = "black" )
virus_info |
virus information |
flow_info |
flow information |
v_color |
the color of outer boundary of virus; can use expression (e.g. v_color=~Host) to color virus by specific variable |
v_fill |
the color to fill viruses; can use expression (e.g. v_fill=~Host) to fill virus by specific variable |
v_shape |
one of 'hexagon' or 'ellipse' |
l_color |
color of the lines that indicate genetic flow |
asp |
aspect ratio of the plotting device |
parse |
whether parse label, only works if 'label' and 'label_position' exist |
g_height |
height of regions to plot gene segments relative to the virus |
g_width |
width of gene segment relative to width of the virus (the hexagon) |
t_size |
size of text label |
t_color |
color of text label |
geom layer
Guangchuang Yu
library(tibble) library(ggplot2) n <- 8 virus_info <- tibble(id = 1:7, x = c(rep(1990, 4), rep(2000, 2), 2009), y = c(1,2,3,5, 1.5, 3, 4), segment_color = list(rep('purple', n), rep('red', n), rep('darkgreen', n), rep('lightgreen', n), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'red', 'purple', 'red', 'purple'), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'), c('darkgreen', 'lightgreen', 'lightgreen', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'))) flow_info <- tibble(from = c(1,2,3,3,4,5,6), to = c(5,5,5,6,7,6,7)) ggplot() + geom_hybrid(virus_info, flow_info)
library(tibble) library(ggplot2) n <- 8 virus_info <- tibble(id = 1:7, x = c(rep(1990, 4), rep(2000, 2), 2009), y = c(1,2,3,5, 1.5, 3, 4), segment_color = list(rep('purple', n), rep('red', n), rep('darkgreen', n), rep('lightgreen', n), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'red', 'purple', 'red', 'purple'), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'), c('darkgreen', 'lightgreen', 'lightgreen', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'))) flow_info <- tibble(from = c(1,2,3,3,4,5,6), to = c(5,5,5,6,7,6,7)) ggplot() + geom_hybrid(virus_info, flow_info)
visualize virus reassortment events
hybrid_plot( virus_info, flow_info, v_color = "darkgreen", v_fill = "steelblue", v_shape = "ellipse", l_color = "black", asp = 1, parse = FALSE, g_height = 0.65, g_width = 0.65, t_size = 3.88, t_color = "black" )
hybrid_plot( virus_info, flow_info, v_color = "darkgreen", v_fill = "steelblue", v_shape = "ellipse", l_color = "black", asp = 1, parse = FALSE, g_height = 0.65, g_width = 0.65, t_size = 3.88, t_color = "black" )
virus_info |
virus information |
flow_info |
flow information |
v_color |
the color of outer boundary of virus; can use expression (e.g. v_color=~Host) to color virus by specific variable |
v_fill |
the color to fill viruses; can use expression (e.g. v_fill=~Host) to fill virus by specific variable |
v_shape |
one of 'hexagon' or 'ellipse' |
l_color |
color of the lines that indicate genetic flow |
asp |
aspect ratio of the plotting device |
parse |
whether parse label, only works if 'label' and 'label_position' exist |
g_height |
height of regions to plot gene segments relative to the virus |
g_width |
width of gene segment relative to width of the virus (the hexagon) |
t_size |
size of text label |
t_color |
color of text label |
ggplot object
Guangchuang Yu
library(tibble) n <- 8 virus_info <- tibble(id = 1:7, x = c(rep(1990, 4), rep(2000, 2), 2009), y = c(1,2,3,5, 1.5, 3, 4), segment_color = list(rep('purple', n), rep('red', n), rep('darkgreen', n), rep('lightgreen', n), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'red', 'purple', 'red', 'purple'), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'), c('darkgreen', 'lightgreen', 'lightgreen', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'))) flow_info <- tibble(from = c(1,2,3,3,4,5,6), to = c(5,5,5,6,7,6,7)) hybrid_plot(virus_info, flow_info)
library(tibble) n <- 8 virus_info <- tibble(id = 1:7, x = c(rep(1990, 4), rep(2000, 2), 2009), y = c(1,2,3,5, 1.5, 3, 4), segment_color = list(rep('purple', n), rep('red', n), rep('darkgreen', n), rep('lightgreen', n), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'red', 'purple', 'red', 'purple'), c('darkgreen', 'darkgreen', 'red', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'), c('darkgreen', 'lightgreen', 'lightgreen', 'darkgreen', 'darkgreen', 'purple', 'red', 'purple'))) flow_info <- tibble(from = c(1,2,3,3,4,5,6), to = c(5,5,5,6,7,6,7)) hybrid_plot(virus_info, flow_info)
set layout for reassortment plot
set_layout(virus_info, flow_info, layout = "layout.auto")
set_layout(virus_info, flow_info, layout = "layout.auto")
virus_info |
virus information |
flow_info |
flow information |
layout |
layout method |
updated virus_info
Guangchuang Yu