The goal of BioVizSeq is to visualize the types and distribution of elements within bio-sequences. At the same time, We have developed a geom layer, geom_rrect(), that can generate rounded rectangles. No external references are used in the development of this package.
Install from CRAN:
# Install from CRAN
install.packages("BioVizSeq")
Install from Github: the development version of BioVizSeq:
install.packages("devtools")
::install_github("zhaosq2022/BioVizSeq") devtools
library(BioVizSeq)
#> Registered S3 methods overwritten by 'treeio':
#> method from
#> MRCA.phylo tidytree
#> MRCA.treedata tidytree
#> Nnode.treedata tidytree
#> Ntip.treedata tidytree
#> ancestor.phylo tidytree
#> ancestor.treedata tidytree
#> child.phylo tidytree
#> child.treedata tidytree
#> full_join.phylo tidytree
#> full_join.treedata tidytree
#> groupClade.phylo tidytree
#> groupClade.treedata tidytree
#> groupOTU.phylo tidytree
#> groupOTU.treedata tidytree
#> inner_join.phylo tidytree
#> inner_join.treedata tidytree
#> is.rooted.treedata tidytree
#> nodeid.phylo tidytree
#> nodeid.treedata tidytree
#> nodelab.phylo tidytree
#> nodelab.treedata tidytree
#> offspring.phylo tidytree
#> offspring.treedata tidytree
#> parent.phylo tidytree
#> parent.treedata tidytree
#> root.treedata tidytree
#> rootnode.phylo tidytree
#> sibling.phylo tidytree
#> Package BioVizSeq loaded successfully!
# Extra package
library(ggplot2)
#> Warning: 程辑包'ggplot2'是用R版本4.3.3 来建造的
gff or gtf file
<- system.file("extdata", "idpro.gff3", package = "BioVizSeq")
gff_path <- read.table(gff_path, header = FALSE, sep = '\t')
gff_data <- gff_to_loc(gff_data)
gff_loc
motif_plot(gff_loc$table_loc, gff_loc$gene_length) +
labs(x="DNA length (5'-3')", y="Gene name")
<- system.file("extdata", "idpro.gff3", package = "BioVizSeq")
gff_path gff_plot(gff_path)
meme.xml or mast.xml
<- system.file("extdata", "meme.xml", package = "BioVizSeq")
meme_path <- readLines(meme_path)
meme_file <- get_motif_location(meme_file)
motif_loc
motif_plot(motif_loc$table_loc, motif_loc$gene_length)
<- system.file("extdata", "meme.xml", package = "BioVizSeq")
meme_path meme_plot(meme_path)
Download: .tsv
<- system.file("extdata", "iprscan.tsv", package = "BioVizSeq")
pfam_path <- read.table(pfam_path, sep='\t', header = FALSE)
pfam_file <- pfam_to_loc(pfam_file)
domain_loc
motif_plot(domain_loc$table_loc, domain_loc$gene_length)
<- system.file("extdata", "iprscan.tsv", package = "BioVizSeq")
pfam_path pfam_plot(pfam_path)
Download “Superfamily Only”
Type: .txt
<- system.file("extdata", "hitdata.txt", package = "BioVizSeq")
hitdata_path <- readLines(hitdata_path)
cdd_file <- cdd_to_loc(cdd_file)
domain_loc
<- system.file("extdata", "idpep.fa", package = "BioVizSeq")
fa_path <- fastaleng(fa_path)
gene_length motif_plot(domain_loc, gene_length)
<- system.file("extdata", "hitdata.txt", package = "BioVizSeq")
hitdata_path <- system.file("extdata", "idpep.fa", package = "BioVizSeq")
fa_path
cdd_plot(hitdata_path, fa_path)
protein file (.fa or .fasta)
<- system.file("extdata", "target.fa", package = "BioVizSeq")
fa_path <- smart_to_loc(fa_path)
domain_loc #> Submitting sequence AtAP2_002...
#> Submitting sequence AtAP2_003...
#> Job entered the queue with ID12315310532207961734854988nxRvSILzcN. Waiting for results.
#> Submitting sequence AtAP2_004...
#> Submitting sequence AtAP2_005...
motif_plot(domain_loc$table_loc, domain_loc$gene_length)
<- system.file("extdata", "target.fa", package = "BioVizSeq")
fa_path
smart_plot(fa_path)
#> Submitting sequence AtAP2_002...
#> Submitting sequence AtAP2_003...
#> Job entered the queue with ID12315310532216911734855018RDVNZgsHWd. Waiting for results.
#> Submitting sequence AtAP2_004...
#> Submitting sequence AtAP2_005...
promoter sequence(.fa or .fasta)
# 1. upload fasta file to plantcare, get the result file(.tab)
# upload_fa_to_plantcare(fasta_file, email)
# 2. Classify the functions of cis element
<- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq")
plantcare_path <- read.table(plantcare_path, header = FALSE, sep = '\t', quote="")
plantcare_file <- plantcare_classify(plantcare_file)
plantcare_data <- plantcare_to_loc(plantcare_data)
plantcare_loc
<- data.frame(ID = unique(plantcare_loc$ID), length=2000)
promoter_length
motif_plot(plantcare_loc, promoter_length) +
labs(x="Promoter Length", y="Gene")
<- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq")
plantcare_path plantcare_plot(plantcare_path, promoter_length = 2000)
p_tree, p_gff, p_pfam, p_meme, p_smart, p_cdd, p_plantcare
library(patchwork)
<- system.file("extdata", "idpep.nwk", package = "BioVizSeq")
tree_path <- system.file("extdata", "idpro.gff3", package = "BioVizSeq")
gff_path <- system.file("extdata", "meme.xml", package = "BioVizSeq")
meme_path <- system.file("extdata", "iprscan.tsv", package = "BioVizSeq")
pfam_path <- combi_p(tree_path = tree_path, gff_path = gff_path,
plot_file meme_path = meme_path, pfam_path = pfam_path)
$p_tree + plot_file$p_gff + plot_file$p_pfam +
plot_file$p_meme +plot_layout(ncol = 4) +
plot_fileplot_annotation(
tag_levels = 'A'
)