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 selectedgene_set
should be retuned.- use_only_map
a logical value indicating whether instead of a standard
ExpressionSet
only aPhylostratigraphic Map
orDivergene 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
.
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")
#> Error in PlotGeneSet(ExpressionSet = PhyloExpressionSetExample, gene_set = PhyloExpressionSetExample[1:5, 2], lty = 1, lwd = 4, xlab = "Ontogeny", ylab = "Expression Level"): could not find function "PlotGeneSet"
# 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)
#> # A tibble: 5 × 5
#> Phylostratum GeneID Stage Expression distance_sum
#> <int> <fct> <fct> <dbl> <dbl>
#> 1 1 at1g01040.2 Zygote 2174. 243600.
#> 2 1 at1g01050.1 Quadrant 1817. 237017.
#> 3 1 at1g01070.1 Torpedo 864. 238465.
#> 4 1 at1g01080.2 Mature 861. 238563.
#> 5 1 at1g01090.1 Bent 66980. 2075607.
#> Scale for y is already present.
#> Adding another scale for y, which will replace the existing scale.
#> Phylostratum GeneID Zygote Quadrant Globular Heart Torpedo
#> 1 1 at1g01040.2 2173.635 1911.2001 1152.555 1291.4224 1000.253
#> 2 1 at1g01050.1 1501.014 1817.3086 1665.309 1564.7612 1496.321
#> 3 1 at1g01070.1 1212.793 1233.0023 939.200 929.6195 864.218
#> 4 1 at1g01080.2 1016.920 936.3837 1181.338 1329.4734 1392.643
#> 5 1 at1g01090.1 11424.567 16778.1685 34366.649 39775.6405 56231.569
#> Bent Mature
#> 1 962.9772 1696.4274
#> 2 1114.6435 1071.6555
#> 3 877.2060 894.8189
#> 4 1287.9746 861.2605
#> 5 66980.3673 7772.5617
# 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)
#> Error: measure variables not found in data: NA
# 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
)
#> # A tibble: 5 × 5
#> Phylostratum GeneID Stage Expression distance_sum
#> <int> <fct> <fct> <dbl> <dbl>
#> 1 1 at1g01040.2 Zygote 2174. 243600.
#> 2 1 at1g01050.1 Quadrant 1817. 237017.
#> 3 1 at1g01070.1 Torpedo 864. 238465.
#> 4 1 at1g01080.2 Mature 861. 238563.
#> 5 1 at1g01090.1 Bent 66980. 2075607.
#> Scale for y is already present.
#> Adding another scale for y, which will replace the existing scale.