Gene Relevance plotting {destiny} | R Documentation

## Plot gene relevance or differential map

### Description

`plot(gene_relevance, 'Gene')` plots the differential map of this/these gene(s), `plot(gene_relevance)` a relevance map of a selection of genes. Alternatively, you can use `plot_differential_map` or `plot_gene_relevance` on a `GeneRelevance` or `DiffusionMap` object, or with two matrices.

### Usage

    ## S4 method for signature 'GeneRelevance,character'
    plot(x, y, ...)

    ## S4 method for signature 'GeneRelevance,numeric'
    plot(x, y, ...)

    ## S4 method for signature 'GeneRelevance,missing'
    plot(x, y, ...)

    plot_differential_map(coords, exprs, ..., gene, dims = 1:2,
      pal = cube_helix, faceter = facet_wrap(~Gene))

    ## S4 method for signature 'matrix,matrix'
    plot_differential_map(coords, exprs, ..., gene,
      dims = 1:2, pal = cube_helix, faceter = facet_wrap(~Gene))

    ## S4 method for signature 'DiffusionMap,missing'
    plot_differential_map(coords, exprs, ..., gene,
      dims = 1:2, pal = cube_helix, faceter = facet_wrap(~Gene))

    ## S4 method for signature 'GeneRelevance,missing'
    plot_differential_map(coords, exprs, ...,
      gene, dims = 1:2, pal = cube_helix, faceter = facet_wrap(~Gene))

    plot_gene_relevance(coords, exprs, ..., iter_smooth = 2L, genes = 5L,
      dims = 1:2, pal = palette())

    ## S4 method for signature 'matrix,matrix'
    plot_gene_relevance(coords, exprs, ...,
      iter_smooth = 2L, genes = 5L, dims = 1:2, pal = palette())

    ## S4 method for signature 'DiffusionMap,missing'
    plot_gene_relevance(coords, exprs, ...,
      iter_smooth = 2L, genes = 5L, dims = 1:2, pal = palette())

    ## S4 method for signature 'GeneRelevance,missing'
    plot_gene_relevance(coords, exprs, ...,
      iter_smooth = 2L, genes = 5L, dims = 1:2, pal = palette())

### Arguments

`x` | `GeneRelevance` object.
`y, gene` | Gene name(s) or index/indices to create differential map for. (integer or character)
`...` | Passed to `plot_differential_map`/`plot_gene_relevance`.
`coords` | A `DiffusionMap`/`GeneRelevance` object or a cells \times dims `matrix`.
`exprs` | An cells \times genes `matrix`. Only provide if `coords` is a matrix.
`dims` | Names or indices of dimensions to plot. When not plotting a `GeneRelevance` object, the relevance for the dimensions `1:max(dims)` will be calculated.
`pal` | Palette. Either A colormap function or a list of colors.
`faceter` | A ggplot faceter like `facet_wrap(~ Gene)`.
`iter_smooth` | Number of label smoothing iterations to perform on relevance map. The higher the more homogenous and the less local structure.
`genes` | Genes to based relevance map on or number of genes to use. (vector of strings or one number) You can also pass an index into the gene names. (vector of numbers or logicals with length > 1)

### Value

ggplot2 plot, when plotting a relevance map with a list member `$ids` containing the gene IDs used.

### See Also

`gene_relevance`, Gene Relevance methods

### Examples

    data(guo_norm)
    dm <- DiffusionMap(guo_norm)
    gr <- gene_relevance(dm)
    plot(gr)          # or plot_gene_relevance(dm)
    plot(gr, 'Fgf4')  # or plot_differential_map(dm, 'Fgf4')

    guo_norm_mat <- t(Biobase::exprs(guo_norm))
    pca <- prcomp(guo_norm_mat)$x
    plot_gene_relevance(pca, guo_norm_mat, dims = 2:3)
    plot_differential_map(pca, guo_norm_mat, gene = c('Fgf4', 'Nanog'))

[Package destiny version 2.12.0 Index]