gggenomes简介
gggenomes是一款基于R语言的拓展工具包,旨在提供一套强大而灵活的工具,用于基因组数据的可视化与分析。gggenomes的设计理念源于ggplot2,它使用了类似于ggplot2的语法来创建精美的图形,并提供了丰富的功能和选项来满足不同类型的基因组数据可视化需求。
gggenomes基本使用方法
- 安装gggenomes
要使用gggenomes,首先需要在R环境中安装该工具包。可以使用以下代码安装gggenomes:
代码语言:javascript复制# install ggtree
# https://bioconductor.org/packages/release/bioc/html/ggtree.html
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("ggtree")
# install.packages("devtools")
devtools::install_github("thackl/thacklr")
devtools::install_github("thackl/gggenomes")
- 可视化展示 这里我们直接列举几个可视化案例供大家参考:
案例一:
代码语言:javascript复制emale_blast <- read_blast("emales_mavirus-blastp.tsv")
emale_blast %<>%
filter(evalue < 1e-3) %>%
select(feature_id=qaccver, start=qstart, end=qend, saccver) %>%
left_join(read_tsv("mavirus.tsv", col_names = c("saccver", "blast_hit", "blast_desc")))
# manual annotations by MFG
emale_transposons <- read_gff("emales-manual.gff", types = c("mobile_element"))
p7 <- gggenomes(emale_seqs_6, emale_genes, emale_tirs, emale_links) %>%
add_features(emale_gc) %>%
add_clusters(genes, emale_cogs) %>%
add_features(emale_transposons) %>%
add_subfeatures(genes, emale_blast, transform="aa2nuc") %>%
flip_bins(3:5)
geom_feature(aes(color="integrated transposon"),
use_features(emale_transposons), size=7)
geom_seq() geom_bin_label()
geom_link(offset = c(0.3, 0.2), color="white", alpha=.3)
geom_feature(aes(color="terminal inverted repeat"), use_features(features),
size=4)
geom_gene(aes(fill=cluster_label))
geom_feature(aes(color=blast_desc), use_features(emale_blast), size=2,
position="pile")
geom_ribbon(aes(x=(x xend)/2, ymax=y .24, ymin=y .38-(.4*score),
group=seq_id, linetype="GC-content"), use_features(emale_gc),
fill="blue", alpha=.5)
scale_fill_brewer("Conserved genes", palette="Set3")
scale_color_viridis_d("Blast hits & Features", direction = -1)
scale_linetype("Graphs")
ggtitle(expression(paste("Endogenous mavirus-like elements of ",
italic("C. burkhardae"))))
p7
Example01 of gggenomes
案例二:
代码语言:javascript复制library(gggenomes)
# to inspect the example data shipped with gggenomes
data(package="gggenomes")
gggenomes(emale_genes, emale_seqs, emale_tirs, emale_ava) %>%
add_feats(ngaros=emale_ngaros, gc=emale_gc) %>%
add_sublinks(emale_prot_ava) %>%
flip_by_links()
geom_feat(position="identity", size=6)
geom_seq()
geom_link(data=links(2))
geom_bin_label()
geom_gene(aes(fill=name))
geom_gene_tag(aes(label=name), nudge_y=0.1, check_overlap = TRUE)
geom_feat(data=feats(ngaros), alpha=.3, size=10, position="identity")
geom_feat_note(aes(label="Ngaro-transposon"), feats(ngaros),
nudge_y=.1, vjust=0)
geom_ribbon(aes(x=(x xend)/2, ymax=y .24, ymin=y .38-(.4*score),
group=seq_id, linetype="GC-content"), feats(gc),
fill="lavenderblush4", position=position_nudge(y=-.1))
scale_fill_brewer("Genes", palette="Dark2", na.value="cornsilk3")
Example02 of gggenomes
总结
gggenomes 在基因组研究中有着广泛的应用。它可以用于可视化基因组组装结果、基因表达数据、染色体交互作用等。通过使用gggenomes,研究人员可以更直观地了解基因组的结构和功能,从而为基因组研究和生物信息学分析提供有力支持。感兴趣的同学可以安装使用下~~