PCA / MDS / tSNE visualisation (mainly overlap / gene usage)

# S3 method for immunr_mds
  .by = NA,
  .meta = NA,
  .point = TRUE,
  .text = TRUE,
  .ellipse = TRUE,
  .point.size = 2,
  .text.size = 4,



Output from analysis functions such as geneUsageAnalysis or immunr_pca, immunr_mds or immunr_tsne.


Pass NA if you want to plot samples without grouping.

You can pass a character vector with one or several column names from ".meta" to group your data before plotting. In this case you should provide ".meta".

You can pass a character vector that exactly matches the number of samples in your data, each value should correspond to a sample's property. It will be used to group data based on the values provided. Note that in this case you should pass NA to ".meta".


A metadata object. An R dataframe with sample names and their properties, such as age, serostatus or hla.


Logical. If TRUE then plot points corresponding to objects.


Logical. If TRUE then plot sample names.


Logical. If TRUE then plot ellipses around clusters of grouped samples.


Numeric. A size of points to plot.


Numeric. A size of sample names' labels.


Not used here.


A ggplot2 object.


Other visualisation methods:

- PCA - vis.immunr_pca

- MDS - vis.immunr_mds

- tSNE - vis.immunr_tsne


ov <- repOverlap(immdata$data)
repOverlapAnalysis(ov, "mds") %>% vis()