nice_tSNE: Function to make tSNE plots.

View source: R/nice_tSNE.R

nice_tSNER Documentation

Function to make tSNE plots.

Description

Function to make tSNE plots.

Usage

nice_tSNE(
  object,
  seed = 0,
  perplexity = 3,
  max_iterations = 10000,
  returnData = FALSE,
  variables = c(fill = "VarFill", shape = "VarShape"),
  colors = NULL,
  shapes = NULL,
  size = 7,
  alpha = 1,
  legend_names = c(fill = "Label Fill", shape = "Label Shape"),
  legend_title = 20,
  legend_elements = 16,
  legend_pos = c(0.8, 0.8, "right"),
  labels = NULL,
  name_tags = NULL
)

Arguments

object

A DEseq object already transformed with the variance stabilizing or rlog transformations.

seed

To set the random seed.

perplexity

The average number of samples by patient (neighbors in a set).

max_iterations

Maximum number of iterations to perform.

returnData

Indicates if the function should return the data (TRUE) or the plot (FALSE). Default: FALSE.

variables

To indicate the variables to be used as Shape and Fill of the markers.

colors

Vector of colors to be used for the categories of the variable assigned as Marker Fill.

shapes

Vector of shapes to be used for the categories of the variable assigned as Marker Shape.

size

Size of the marker. Default: 7.

alpha

Transparency of the marker, which goes from 0 (transparent) to 1 (no transparent). Default: 1.

legend_names

The names to be used for the legend of the Shape and Fill.

legend_title

Font of the legend title. Default: 20.

legend_elements

Font of the elements of the legend Default: 16.

legend_pos

Position of the legend in the plot. Default: c(0.80, 0.80, "right").

labels

A vector containing the variable to be used as labels (name inside the marker), and the label size. Example: c(var = "patient", size = 2). Default: NULL (no labels).

name_tags

A vector containing the variable to be used as name tags (name outside the marker), tag size, minimum distance in order to add an arrow connecting the tag and the marker, and minimum distance from the tag and the center of the marker. Example: c(var = "label", size = 3, minlen = 2, box = 0.5). Default: NULL (no name tags).


davidrequena/drfun documentation built on May 15, 2024, 10:33 a.m.