Learn R Programming

KEGGprofile (version 1.14.0)

plot_profile: plot_profile

Description

The function plot gene expression profiles on KEGG pathway maps

Usage

plot_profile(gene_expr, pathway_name, result_name = paste(pathway_name, "_profile_", type, ".png", sep = ""), KEGG_database, groups, bg_col = "white", text_col = "black", line_col, border_col = "grey", text_cex = 0.25, magnify = 1, type = c("lines", "bg"), pathway_min = 5, genes_kept = c("foldchange", "first", "random", "var", "abs"), species = "hsa", database_dir = getwd(), max_dist, lwd = 1.2, speciesRefMap = TRUE)

Arguments

gene_expr
the matrix for gene expression, row.names should be NCBI gene ID, such as 67040, 93683
pathway_name
the species id and KEGG pathway id, such as 'hsa00010'
result_name
the name of figure file generated by KEGGprofile. The default name is pathway_name+'_profile_'+type+'.png', such as 'hsa04110_profile_lines.png'
KEGG_database
the matrix returned by function parse_XMLfile, which contains genes in this pathway, and their names, locations etc
groups
a character used to indicate expression values from different types of samples
bg_col
background color for gene rectangles in the pathway map
text_col
the colors for text in the pathway map. A color matrix generated by function col_by_value can be used here
line_col
line color for expression in different samples in the pathway map, valid when type='lines'
border_col
border color for gene rectangles in the pathway map. A color matrix generated by function col_by_value can be used here
text_cex
cex for text in the pathway map. A color matrix generated by function col_by_value can be used here
magnify
the coefficient used to magnify the gene rectangles
type
the type of pathway map visulization, could be 'bg' or 'lines'. Default is 'bg'. See also 'Details'
pathway_min
The pathways with number of annotated genes less than pathway_min would be ignored
genes_kept
methods used for choosing genes when several genes corresponding to one location in pathway map. Default is 'foldchange', which kept the gene with largest fold changes. 'first' kept the first gene. 'random' chosed gene random. 'var' kept the gene with largest variation. 'abs' kept the gene with largest absolute value
species
the species id in KEGG database, 'hsa' means human, 'mmu' means mouse, 'rno' means rat, etc
database_dir
the directory where the XML files and png files are located
max_dist
The expression changes that represented by the distance from the bottom to the top of gene rectangle, valid when type='lines'. This param is used to ensure the dynamic changes of lines in different gene polygon represent equal variation. It would be calculated from the maximum changes of genes in this pathway by default. If max_dist=NA, then the lines would be plotted from top to bottom in each gene rectangle
lwd
The line width when type='lines'
speciesRefMap
Logical, use the species specific figure as reference map. if set as FALSE, the reference pathway figure without species information will be used

Value

a matrix containing genes maped in this pathway, and their names, expressions

Details

There are two visualization methods to represent gene expression profiles: 'background' and 'lines'. The first one is applicable for analysis with only one sample or one type of data, which divides the gene polygon into several sub-polygons to represent different time points. And each sub-polygon has a specific background color to represent expression changes in that time point. The second method plots lines with different colors in the gene polygon to represent different samples or different types of data. The dynamic changes of lines mean the profiles of genes in different time points.

Examples

Run this code
XML2database<-parse_XMLfile(pathway_id="04110",species="hsa",database_dir=system.file("extdata",package="KEGGprofile"))
data(pro_pho_expr)
temp<-plot_profile(pro_pho_expr,pathway_name="hsa04110",KEGG_database=XML2database,line_col=c("brown1","seagreen3"),groups=c(rep("Proteome ",6),rep("Phosphoproteome ",6)),magnify=1.2,database_dir=system.file("extdata",package="KEGGprofile"),max_dist=5)

Run the code above in your browser using DataLab