plot_linear_scatter: Make a scatter plot between two groups with a linear model...

View source: R/plot_point.R

plot_linear_scatterR Documentation

Make a scatter plot between two groups with a linear model superimposed and some supporting statistics.

Description

Make a scatter plot between two groups with a linear model superimposed and some supporting statistics.

Usage

plot_linear_scatter(
  df,
  cormethod = "pearson",
  size = 2,
  loess = FALSE,
  xcol = NULL,
  ycol = NULL,
  text_col = NULL,
  logfc = 2,
  identity = FALSE,
  z = 1.5,
  z_lines = FALSE,
  first = NULL,
  second = NULL,
  base_url = NULL,
  pretty_colors = TRUE,
  xlab = NULL,
  ylab = NULL,
  color_high = NULL,
  color_low = NULL,
  alpha = 0.4,
  ...
)

Arguments

df

Dataframe likely containing two columns.

cormethod

What type of correlation to check?

size

Size of the dots on the plot.

loess

Add a loess estimation?

xcol

Column name of x-values

ycol

Column name of y-values#'

text_col

Column containing text annotations.

logfc

Point out genes with a specific logfc.

identity

Add the identity line?

z

Use this z-score cutoff.

z_lines

Include lines defining the z-score boundaries.

first

First column to plot.

second

Second column to plot.

base_url

Base url to add to the plot.

pretty_colors

Colors!

xlab

Alternate x-axis label.

ylab

Alternate x-axis label.

color_high

Chosen color for points significantly above the mean.

color_low

Chosen color for points significantly below the mean.

alpha

Choose an alpha channel to define how see-through the dots are.

...

Extra args likely used for choosing significant genes.

Value

List including a ggplot2 scatter plot and some histograms. This plot provides a "bird's eye" view of two data sets. This plot assumes a (potential) linear correlation between the data, so it calculates the correlation between them. It then calculates and plots a robust linear model of the data using an 'SMDM' estimator (which I don't remember how to describe, just that the document I was reading said it is good). The median/mad of each axis is calculated and plotted as well. The distance from the linear model is finally used to color the dots on the plot. Histograms of each axis are plotted separately and then together under a single cdf to allow tests of distribution similarity. This will make a fun clicky googleVis graph if requested.

See Also

[robust] [stats] [ggplot2] [robust::lmRob] [stats::weights] [plot_histogram()]

Examples

## Not run: 
 plot_linear_scatter(lotsofnumbers_intwo_columns)

## End(Not run)

elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.