plot_sample: Plot the distances for a given sample

Description Usage Arguments Value Examples

View source: R/plot_sample.R

Description

Plot the distances for a given sample, highlighting itself and the closest sample

Usage

1
2
3
4
5
6
7
8
plot_sample(
  d,
  sample,
  dimension = c("row", "column"),
  get_min = TRUE,
  add_labels = TRUE,
  ...
)

Arguments

d

A distance or similarity matrix

sample

Sample ID (in row or column names)

dimension

Whether to look at the row or column

get_min

If TRUE, get the minimum (for a distance matrix); if FALSE, get the maximum (for a similarity matrix)

add_labels

If TRUE, label the individual sample and the optimal sample

...

Passed to points()

Value

None.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# align rows in the provided dataset, lineup2ex
aligned <- align_matrix_rows(lineup2ex$gastroc, lineup2ex$islet)
# find correlated columns
selected_genes <- (corr_betw_matrices(aligned[[1]], aligned[[2]], "paired") > 0.75)
# calculate correlation between rows
similarity <- corr_betw_matrices(t(lineup2ex$gastroc[,selected_genes]),
                                 t(lineup2ex$islet[,selected_genes]), "all")

plot_sample(similarity, "Mouse3659", get_min=FALSE)
plot_sample(similarity, "Mouse3655", "column", get_min=FALSE)

lineup2 documentation built on June 15, 2021, 9:07 a.m.