plot_gene_set: Plot the Expression Profiles of a Gene Set

View source: R/plot_gene_set.R

plot_gene_setR Documentation

Plot the Expression Profiles of a Gene Set

Description

This function simply visualizes the gene expression profiles of a defined subset of genes stored in the input ExpressionSet. The maximum nummber of genes to visualize at once is 25.

Usage

plot_gene_set(
  ExpressionSet,
  gene_set,
  get_subset = FALSE,
  use_only_map = FALSE,
  colors = NULL,
  plot_legend = TRUE,
  y_ticks = 6,
  digits_ylab = 1,
  line_width = 1,
  point_size = 2,
  add_expression_values = FALSE,
  n_genes_for_distance = 1,
  ...
)

Arguments

ExpressionSet

a standard PhyloExpressionSet or DivergenceExpressionSet object.

gene_set

a character vector storing the gene ids for which gene expression profiles shall be visualized.

get_subset

a logical value indicating whether or not an ExpressionSet subset of the selected gene_set should be retuned.

use_only_map

a logical value indicating whether instead of a standard ExpressionSet only a Phylostratigraphic Map or Divergene Map is passed to the function.

colors

colors for gene expression profiles. Default: colors = NULL, hence default colours are used.

plot_legend

a logical value indicating whether gene ids should be printed as legend next to the plot.

y_ticks

a numeric value specifying the number of ticks to be drawn on the y-axis.

digits_ylab

a numeric value specifying the number of digits shown for the expression levels on the y-axis.

add_expression_values

a logical value indicating whether expression values should be displayed on the plot.

n_genes_for_distance

a numeric value specifying the number of top genes to be selected based on the highest distance sum.

...

additional parameters passed to matplot.

Details

This function simply visualizes or subsets the gene expression levels of a set of genes that are stored in the input ExpressionSet.

Author(s)

Hajk-Georg Drost and Filipa Martins Costa

See Also

SelectGeneSet, PlotEnrichment, DiffGenes

Examples

data(PhyloExpressionSetExample)

# the best parameter setting to visualize this plot:
# png("test_png.png",700,400)
PlotGeneSet(ExpressionSet = PhyloExpressionSetExample, 
            gene_set      = PhyloExpressionSetExample[1:5, 2], 
            lty           = 1, 
            lwd           = 4,
            xlab          = "Ontogeny",
            ylab          = "Expression Level")

# dev.off()

# In case you would like to work with the expression levels
# of selected genes you can specify the 'get_subset' argument:

plot_gene_set(ExpressionSet = PhyloExpressionSetExample, 
            gene_set      = PhyloExpressionSetExample[1:5, 2], 
            get_subset    = TRUE)


# get a gene subset using only a phylostratihraphic map
ExamplePSMap <- PhyloExpressionSetExample[ , 1:2]

plot_gene_set(ExpressionSet = ExamplePSMap, 
            gene_set      = PhyloExpressionSetExample[1:5, 2], 
            get_subset    = TRUE,
            use_only_map  = TRUE)
            
# In case you want the expression values to appear for the 2 genes with a most differentiated profile
plot_gene_set(ExpressionSet = PhyloExpressionSetExample, 
            gene_set      = PhyloExpressionSetExample[1:5, 2], 
            add_expression_values =T,
            n_genes_for_distance = 2
            )

drostlab/myTAI documentation built on Feb. 15, 2025, 6:44 p.m.