Title: | Visualizing the Elements Within Bio-Sequences |
---|---|
Description: | Visualizing 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. |
Authors: | Shiqi Zhao [aut, cre, cph] |
Maintainer: | Shiqi Zhao <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.0.0 |
Built: | 2024-12-22 16:38:16 UTC |
Source: | CRAN |
BioVizSeq shiny app start function.
biovizseq()
biovizseq()
Shinyapp: BioVizSeq shiny app.
Shiqi Zhao
# 1. Library BioVizSeq package library(BioVizSeq)
# 1. Library BioVizSeq package library(BioVizSeq)
Visualization of domain in CDD file
cdd_plot( cdd_file, fasta_file, the_order = NULL, domain_select = NULL, shape = "RoundRect", r = 0.3, legend_size = 15, domain_color = NULL )
cdd_plot( cdd_file, fasta_file, the_order = NULL, domain_select = NULL, shape = "RoundRect", r = 0.3, legend_size = 15, domain_color = NULL )
cdd_file |
The path of cdd file. |
fasta_file |
The path of fasta file. |
the_order |
The path of order file. A List of Gene ID , One ID Per Line. |
domain_select |
The domain ID which you want to align with. |
shape |
RoundRect or Rect. |
r |
The radius of rounded corners. |
legend_size |
The size of legend. |
domain_color |
The color set of domain. |
p
Shiqi Zhao
hitdata_path <- system.file("extdata", "hitdata.txt", package = "BioVizSeq") fa_path <- system.file("extdata", "idpep.fa", package = "BioVizSeq") cdd_plot(hitdata_path, fa_path) order_path <- system.file("extdata", "order.csv", package = "BioVizSeq") cdd_plot(hitdata_path, fa_path, the_order = order_path)
hitdata_path <- system.file("extdata", "hitdata.txt", package = "BioVizSeq") fa_path <- system.file("extdata", "idpep.fa", package = "BioVizSeq") cdd_plot(hitdata_path, fa_path) order_path <- system.file("extdata", "order.csv", package = "BioVizSeq") cdd_plot(hitdata_path, fa_path, the_order = order_path)
Extract the location information of domain from cdd file
cdd_to_loc(cdd_file)
cdd_to_loc(cdd_file)
cdd_file |
CDD file. |
data.frame
Shiqi Zhao
hitdata_path <- system.file("extdata", "hitdata.txt", package = "BioVizSeq") cdd_file <- readLines(hitdata_path) domain_loc <- cdd_to_loc(cdd_file)
hitdata_path <- system.file("extdata", "hitdata.txt", package = "BioVizSeq") cdd_file <- readLines(hitdata_path) domain_loc <- cdd_to_loc(cdd_file)
Get ggplot2 files to facilitate free combination in patchwork
combi_p( tree_path, gff_path = NULL, meme_path = NULL, pfam_path = NULL, cdd_path = NULL, fa_path = NULL, plantcare_path = NULL, promoter_length = NULL, shape = "RoundRect", r = 0.3, legend_size = 6 )
combi_p( tree_path, gff_path = NULL, meme_path = NULL, pfam_path = NULL, cdd_path = NULL, fa_path = NULL, plantcare_path = NULL, promoter_length = NULL, shape = "RoundRect", r = 0.3, legend_size = 6 )
tree_path |
The path of tree file (.newick). |
gff_path |
The path of .gff/gtf file. |
meme_path |
The path of .meme/mast file. |
pfam_path |
The path of pfam result file (.tsv). |
cdd_path |
The path of cdd result file (.txt). |
fa_path |
The path of protein file (.fa/fasta). |
plantcare_path |
The path of plantcare file (.tab). |
promoter_length |
The length of promoter. |
shape |
RoundRect or Rect. |
r |
The radius of rounded corners. |
legend_size |
The size of legend. |
list
Shiqi Zhao
tree_path <- system.file("extdata", "idpep.nwk", package = "BioVizSeq") plot_file <- combi_p(tree_path)
tree_path <- system.file("extdata", "idpep.nwk", package = "BioVizSeq") plot_file <- combi_p(tree_path)
Statistical sequence length
fastaleng(fasta_file)
fastaleng(fasta_file)
fasta_file |
The path of protein fasta file. |
data.frame
Shiqi Zhao
fasta_path <- system.file("extdata", "idpep.fa", package = "BioVizSeq") fastaleng(fasta_path)
fasta_path <- system.file("extdata", "idpep.fa", package = "BioVizSeq") fastaleng(fasta_path)
Rounded rectangle
geom_rrect( mapping = NULL, data = NULL, stat = "identity", position = "identity", r = 0.2, ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
geom_rrect( mapping = NULL, data = NULL, stat = "identity", position = "identity", r = 0.2, ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
A data.frame, or other object, will override the plot data. All objects will be fortified to produce a data frame. |
stat |
Name of stat to modify data. |
position |
The position adjustment to use for overlapping points on this layer. |
r |
The radius of rounded corners. |
... |
additional parameter, e.g. color, linewidth, alpha. |
na.rm |
If "FALSE" (default), missing values are removed with a warning. If "TRUE", missing values are silently removed, logical. |
show.legend |
Whether to show legend, logical. |
inherit.aes |
Whether to inherit aesthetic mappings, logical, defaults to "TRUE". |
draws rounded rectangle by using the locations of the four corners (xmin, xmax, ymin and ymax) like geom_rect().
ggplot object
geom_rrect()
understands the following aesthetics (required aesthetics are in bold):
Learn more about setting these aesthetics in vignette("ggplot2-specs")
.
Shiqi Zhao
library(ggplot2) df <- data.frame( xmin = c(1, 2, 3), xmax = c(2, 3, 4), ymin = c(1, 2, 3), ymax = c(2, 3, 4), category = c("A", "B", "C") ) p <- ggplot(df) + geom_rrect(aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, fill = category), r = 0.4, linewidth = 1, colour = "black") print(p)
library(ggplot2) df <- data.frame( xmin = c(1, 2, 3), xmax = c(2, 3, 4), ymin = c(1, 2, 3), ymax = c(2, 3, 4), category = c("A", "B", "C") ) p <- ggplot(df) + geom_rrect(aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, fill = category), r = 0.4, linewidth = 1, colour = "black") print(p)
Extract the location information of motif from mast or meme file
get_motif_location(motif_file)
get_motif_location(motif_file)
motif_file |
The motif data of mast or meme file. |
list
Shiqi Zhao
meme_path <- system.file("extdata", "meme.xml", package = "BioVizSeq") meme_file <- readLines(meme_path) motif_loc <- get_motif_location(meme_file) mast_path <- system.file("extdata", "mast.xml", package = "BioVizSeq") mast_file <- readLines(mast_path) motif_loc <- get_motif_location(mast_file)
meme_path <- system.file("extdata", "meme.xml", package = "BioVizSeq") meme_file <- readLines(meme_path) motif_loc <- get_motif_location(meme_file) mast_path <- system.file("extdata", "mast.xml", package = "BioVizSeq") mast_file <- readLines(mast_path) motif_loc <- get_motif_location(mast_file)
Visualization of element in gff or gtf file
gff_plot( gff_file, the_order = NULL, shape = "Rect", r = 0.3, legend_size = 15, element_color = NULL )
gff_plot( gff_file, the_order = NULL, shape = "Rect", r = 0.3, legend_size = 15, element_color = NULL )
gff_file |
The path of gff file. |
the_order |
The path of order of mRNA. It is also the mRNA you want to showcase. A List of Gene ID , One ID Per Line. |
shape |
RoundRect or Rect. |
r |
The radius of rounded corners. |
legend_size |
The size of legend. |
element_color |
The color set of element. |
p
Shiqi Zhao
gff_path <- system.file("extdata", "test.gff", package = "BioVizSeq") gff_plot(gff_path)
gff_path <- system.file("extdata", "test.gff", package = "BioVizSeq") gff_plot(gff_path)
Extract the location information of element from gff or gtf file
gff_to_loc(gff_data, mRNA_ID = NULL)
gff_to_loc(gff_data, mRNA_ID = NULL)
gff_data |
gff file. |
mRNA_ID |
The mRNA you selected. If NULL, it means selecting all mRNAs. |
list
Shiqi Zhao
gff_path <- system.file("extdata", "test.gff", package = "BioVizSeq") gff_data <- read.table(gff_path, header = FALSE, sep = '\t') gff_loc <- gff_to_loc(gff_data) ID_path <- system.file("extdata", "ID_select.csv", package = "BioVizSeq") mRNA_ID <- readLines(ID_path) gff_loc <- gff_to_loc(gff_data, mRNA_ID=mRNA_ID)
gff_path <- system.file("extdata", "test.gff", package = "BioVizSeq") gff_data <- read.table(gff_path, header = FALSE, sep = '\t') gff_loc <- gff_to_loc(gff_data) ID_path <- system.file("extdata", "ID_select.csv", package = "BioVizSeq") mRNA_ID <- readLines(ID_path) gff_loc <- gff_to_loc(gff_data, mRNA_ID=mRNA_ID)
Visualization of motif in meme file or mast file
meme_plot( meme_file, the_order = NULL, motif_select = NULL, shape = "RoundRect", show_motif_id = FALSE, r = 0.3, legend_size = 15, motif_color = NULL )
meme_plot( meme_file, the_order = NULL, motif_select = NULL, shape = "RoundRect", show_motif_id = FALSE, r = 0.3, legend_size = 15, motif_color = NULL )
meme_file |
The path of meme file or mast file. |
the_order |
The path of order file. A List of Gene ID , One ID Per Line. |
motif_select |
The motif ID which you want to align with. |
shape |
RoundRect or Rect. |
show_motif_id |
Display the name of the motif. |
r |
The radius of rounded corners. |
legend_size |
The size of legend. |
motif_color |
The color set of motif. |
p
Shiqi Zhao
meme_path <- system.file("extdata", "meme.xml", package = "BioVizSeq") meme_plot(meme_path) mast_path <- system.file("extdata", "mast.xml", package = "BioVizSeq") meme_plot(mast_path) meme_plot(meme_path, motif_select="1", show_motif_id = TRUE) order_path <- system.file("extdata", "order.csv", package = "BioVizSeq") meme_plot(meme_path, the_order=order_path, motif_select="1")
meme_path <- system.file("extdata", "meme.xml", package = "BioVizSeq") meme_plot(meme_path) mast_path <- system.file("extdata", "mast.xml", package = "BioVizSeq") meme_plot(mast_path) meme_plot(meme_path, motif_select="1", show_motif_id = TRUE) order_path <- system.file("extdata", "order.csv", package = "BioVizSeq") meme_plot(meme_path, the_order=order_path, motif_select="1")
Draws multiple rounded rectangle.
motif_plot( motif_loc, gene_length, the_order = NULL, motif_select = NULL, shape = "RoundRect", show_motif_id = FALSE, r = 0.3, legend_size = 15, motif_color = NULL )
motif_plot( motif_loc, gene_length, the_order = NULL, motif_select = NULL, shape = "RoundRect", show_motif_id = FALSE, r = 0.3, legend_size = 15, motif_color = NULL )
motif_loc |
A data.frame contains for columuns: ID, motif, start, end. |
gene_length |
A data.fram of the length of biosequences. Two columns: ID, length. |
the_order |
A List of Gene ID , One ID Per Line. |
motif_select |
The motif ID which you want to align with. |
shape |
RoundRect or Rect. |
show_motif_id |
Display the name of the motif. |
r |
The radius of rounded corners. |
legend_size |
The size of legend. |
motif_color |
The color set of motif. |
motif_plot() draws multiple rounded rectangle to represent the above elements of biosequences, but not limited to biosequences
p
Shiqi Zhao
df <- data.frame( ID = rep(c("geneA", "geneB", "geneC"), each = 3), motif = rep(c("1", "2", "3"), times = 3), start = c(1, 3, 6, 1, 6, 10, 10, 7, 17), end = c(3, 5, 11, 3, 8, 15, 12, 9, 22) ) length_data <- data.frame( ID = c("geneA", "geneB", "geneC"), length = c(15, 27, 30) ) order_data <- c("geneB", "geneA", "geneC") motif_plot(df, length_data) motif_plot(df, length_data, the_order = order_data)
df <- data.frame( ID = rep(c("geneA", "geneB", "geneC"), each = 3), motif = rep(c("1", "2", "3"), times = 3), start = c(1, 3, 6, 1, 6, 10, 10, 7, 17), end = c(3, 5, 11, 3, 8, 15, 12, 9, 22) ) length_data <- data.frame( ID = c("geneA", "geneB", "geneC"), length = c(15, 27, 30) ) order_data <- c("geneB", "geneA", "geneC") motif_plot(df, length_data) motif_plot(df, length_data, the_order = order_data)
Get motif sequence from meme file or mast file
motif_seq(meme_file)
motif_seq(meme_file)
meme_file |
The path of meme file or mast file. |
data.frame
Shiqi Zhao
meme_path <- system.file("extdata", "meme.xml", package = "BioVizSeq") meme_file <- readLines(meme_path) motifseq<- motif_seq(meme_file) mast_path <- system.file("extdata", "mast.xml", package = "BioVizSeq") mast_file <- readLines(mast_path) motifseq<- motif_seq(mast_file)
meme_path <- system.file("extdata", "meme.xml", package = "BioVizSeq") meme_file <- readLines(meme_path) motifseq<- motif_seq(meme_file) mast_path <- system.file("extdata", "mast.xml", package = "BioVizSeq") mast_file <- readLines(mast_path) motifseq<- motif_seq(mast_file)
Visualization of domain in pfam result file
pfam_plot( pfam_file, the_order = NULL, domain_select = NULL, shape = "RoundRect", r = 0.3, legend_size = 15, domain_color = NULL )
pfam_plot( pfam_file, the_order = NULL, domain_select = NULL, shape = "RoundRect", r = 0.3, legend_size = 15, domain_color = NULL )
pfam_file |
The path of meme file or mast file. |
the_order |
The path of order file. A List of Gene ID , One ID Per Line. |
domain_select |
The domain ID which you want to align with. |
shape |
RoundRect or Rect. |
r |
The radius of rounded corners. |
legend_size |
The size of legend. |
domain_color |
The color set of domain. |
p
Shiqi Zhao
pfam_path <- system.file("extdata", "iprscan.tsv", package = "BioVizSeq") order_path <- system.file("extdata", "order.csv", package = "BioVizSeq") pfam_plot(pfam_path) pfam_plot(pfam_path, the_order=order_path)
pfam_path <- system.file("extdata", "iprscan.tsv", package = "BioVizSeq") order_path <- system.file("extdata", "order.csv", package = "BioVizSeq") pfam_plot(pfam_path) pfam_plot(pfam_path, the_order=order_path)
Extract the location information of domain from pfam result
pfam_to_loc(pfam_data)
pfam_to_loc(pfam_data)
pfam_data |
The result file (.tsv) of pfam (via InterPro). |
list
Shiqi Zhao
pfam_path <- system.file("extdata", "iprscan.tsv", package = "BioVizSeq") pfam_file <- read.table(pfam_path, sep='\t', header = FALSE) motif_loc <- pfam_to_loc(pfam_file)
pfam_path <- system.file("extdata", "iprscan.tsv", package = "BioVizSeq") pfam_file <- read.table(pfam_path, sep='\t', header = FALSE) motif_loc <- pfam_to_loc(pfam_file)
Classify the functions of cis element from Plantcare
plantcare_classify(plantcare_file)
plantcare_classify(plantcare_file)
plantcare_file |
The result file (.tab) of Plantcare. |
data.frame
Shiqi Zhao
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_file <- read.table(plantcare_path, header = FALSE, sep = '\t', quote="") plantcare_data <- plantcare_classify(plantcare_file)
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_file <- read.table(plantcare_path, header = FALSE, sep = '\t', quote="") plantcare_data <- plantcare_classify(plantcare_file)
Visualization of cis-element in plantcare result file
plantcare_plot( plantcare_file, promoter_length = 2000, the_order = NULL, shape = "Rect", r = 6, legend_size = 15, element_color = NULL )
plantcare_plot( plantcare_file, promoter_length = 2000, the_order = NULL, shape = "Rect", r = 6, legend_size = 15, element_color = NULL )
plantcare_file |
The path of plantcare result file (.tab). |
promoter_length |
The promoter length. |
the_order |
The path of order file. A List of Gene ID , One ID Per Line. |
shape |
RoundRect or Rect. |
r |
The radius of rounded corners. |
legend_size |
The size of legend. |
element_color |
The color set of cis-element. |
p
Shiqi Zhao
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_plot(plantcare_path, promoter_length = 2000)
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_plot(plantcare_path, promoter_length = 2000)
Count the number of cis element from Plantcare for heatmap
plantcare_statistic1(plantcare_data)
plantcare_statistic1(plantcare_data)
plantcare_data |
The result of plantcare_classify(). |
data.frame
Shiqi Zhao
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_file <- read.table(plantcare_path, header = FALSE, sep = '\t', quote="") plantcare_data <- plantcare_classify(plantcare_file) statistic_data1 <- plantcare_statistic1(plantcare_data)
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_file <- read.table(plantcare_path, header = FALSE, sep = '\t', quote="") plantcare_data <- plantcare_classify(plantcare_file) statistic_data1 <- plantcare_statistic1(plantcare_data)
Count the number of cis element from Plantcare for Bar chart
plantcare_statistic2(plantcare_data)
plantcare_statistic2(plantcare_data)
plantcare_data |
The result of plantcare_classify(). |
data.frame
Shiqi Zhao
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_file <- read.table(plantcare_path, header = FALSE, sep = '\t', quote="") plantcare_data <- plantcare_classify(plantcare_file) statistic_data2 <- plantcare_statistic2(plantcare_data)
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_file <- read.table(plantcare_path, header = FALSE, sep = '\t', quote="") plantcare_data <- plantcare_classify(plantcare_file) statistic_data2 <- plantcare_statistic2(plantcare_data)
Extract the location information of cis-element from Plantcare
plantcare_to_loc(plantcare_data)
plantcare_to_loc(plantcare_data)
plantcare_data |
The result of plantcare_classify(). |
data.frame
Shiqi Zhao
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_file <- read.table(plantcare_path, header = FALSE, sep = '\t', quote="") plantcare_data <- plantcare_classify(plantcare_file) plantcare_loc <- plantcare_to_loc(plantcare_data)
plantcare_path <- system.file("extdata", "plantCARE_output.tab", package = "BioVizSeq") plantcare_file <- read.table(plantcare_path, header = FALSE, sep = '\t', quote="") plantcare_data <- plantcare_classify(plantcare_file) plantcare_loc <- plantcare_to_loc(plantcare_data)
Visualization of domain in SMART result file
smart_plot( fasta_file, the_order = NULL, domain_select = NULL, shape = "RoundRect", r = 0.3, legend_size = 15, domain_color = NULL )
smart_plot( fasta_file, the_order = NULL, domain_select = NULL, shape = "RoundRect", r = 0.3, legend_size = 15, domain_color = NULL )
fasta_file |
The path of protein fasta file. |
the_order |
The path of order file. A List of Gene ID , One ID Per Line. |
domain_select |
The domain ID which you want to align with. |
shape |
RoundRect or Rect. |
r |
The radius of rounded corners. |
legend_size |
The size of legend. |
domain_color |
The color set of domain. |
p
Shiqi Zhao
Extract the location information of domain from SMART result
smart_to_loc(input_file, do_pfam = TRUE)
smart_to_loc(input_file, do_pfam = TRUE)
input_file |
The path of potein fasta file. |
do_pfam |
Include the pfam domain or not. |
list
Shiqi Zhao
Upload the promoter file to Plantcare database
upload_fa_to_plantcare(fasta_file, email)
upload_fa_to_plantcare(fasta_file, email)
fasta_file |
The path of promoter file. |
email |
e-mail address. |
Due to the file size limitation of plantcare on fasta, upload_fa_to_plantcare() first splits fasta file. Then uploads the splited fasta files to the plantcare database, and automatically returns the results to the email provided by the user.
upload_fa_to_plantcare("the path/test.fasta", "your e-mail address")
plantcare_result
Shiqi Zhao