plot_differential_map {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

    plot_differential_map(coords, exprs, ..., genes, dims = 1:2,
      pal = hcl.colors, faceter = facet_wrap(~Gene))

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

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

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

    plot_gene_relevance(coords, exprs, ..., iter_smooth = 2L, n_top = 10L,
      genes = NULL, dims = 1:2, pal = palette(), col_na = "grey",
      limit = TRUE)

    ## S4 method for signature 'matrix,matrix'
    plot_gene_relevance(coords, exprs, ...,
      iter_smooth = 2L, n_top = 10L, genes = NULL, dims = 1:2,
      pal = palette(), col_na = "grey", limit = TRUE)

    ## S4 method for signature 'DiffusionMap,missing'
    plot_gene_relevance(coords, exprs, ...,
      iter_smooth = 2L, n_top = 10L, genes = NULL, dims = 1:2,
      pal = palette(), col_na = "grey", limit = TRUE)

    ## S4 method for signature 'GeneRelevance,missing'
    plot_gene_relevance(coords, exprs, ...,
      iter_smooth = 2L, n_top = 10L, genes = NULL, dims = 1:2,
      pal = palette(), col_na = "grey", limit = TRUE)

    plot_gene_relevance_rank(coords, exprs, ..., genes, dims = 1:2,
      n_top = 10L, pal = c("#3B99B1", "#F5191C"), bins = 10L,
      faceter = facet_wrap(~Gene))

    ## S4 method for signature 'matrix,matrix'
    plot_gene_relevance_rank(coords, exprs, ...,
      genes, dims = 1:2, n_top = 10L, pal = c("#3B99B1", "#F5191C"),
      bins = 10L, faceter = facet_wrap(~Gene))

    ## S4 method for signature 'DiffusionMap,missing'
    plot_gene_relevance_rank(coords, exprs,
      ..., genes, dims = 1:2, n_top = 10L, pal = c("#3B99B1", "#F5191C"),
      bins = 10L, faceter = facet_wrap(~Gene))

    ## S4 method for signature 'GeneRelevance,missing'
    plot_gene_relevance_rank(coords, exprs,
      ..., genes, dims = 1:2, n_top = 10L, pal = c("#3B99B1", "#F5191C"),
      bins = 10L, faceter = facet_wrap(~Gene))

    ## 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, ...)

### Arguments

`coords` | A `DiffusionMap`/`GeneRelevance` object or a cells \times dims `matrix`.
`exprs` | An cells \times genes `matrix`. Only provide if `coords` is a matrix.
`...` | Passed to `plot_differential_map`/`plot_gene_relevance`.
`genes` | Genes to base relevance map on (vector of strings). You can also pass an index into the gene names (vector of numbers or logicals with length > 1). The default NULL means all genes.
`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.
`n_top` | Number the top n genes per cell count towards the score defining which genes to return and plot in the relevance map.
`col_na` | Color for cells that end up with no most relevant gene.
`limit` | Limit the amount of displayed gene labels to the amount of available colors in `pal`?
`bins` | Number of hexagonal bins for `plot_gene_relevance_rank`.
`x` | `GeneRelevance` object.
`y` | Gene name(s) or index/indices to create differential map for. (integer or character)

### 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, genes = c('Fgf4', 'Nanog'))

[Package destiny version 3.1.0 Index]