Package 'scatterHatch'

Title: Creates hatched patterns for scatterplots
Description: The objective of this package is to efficiently create scatterplots where groups can be distinguished by color and texture. Visualizations in computational biology tend to have many groups making it difficult to distinguish between groups solely on color. Thus, this package is useful for increasing the accessibility of scatterplot visualizations to those with visual impairments such as color blindness.
Authors: Atul Deshpande [aut, cre]
Maintainer: Atul Deshpande <[email protected]>
License: MIT + file LICENSE
Version: 1.13.0
Built: 2024-10-31 04:35:11 UTC
Source: https://github.com/bioc/scatterHatch

Help Index


Tissue-CyCIF data of Pancreatic Ductal Adenocarcinoma (PDAC)

Description

Single-cell resolution of 4 cellular compartments in a human Pancreatic Dual Adenocarcinoma sample that spans across three distinct tissues: the pancreas, small intestine, and tumor. Contains cartesian coordinates of each cell along with the frame it was identified from in t-CyCIF imaging.

Usage

data(pdacData)

Format

A data frame with 158159 rows and 3 variables:

frame

10x frame from t-CyCIF imaging. Used to identify tissue type of cell.

Xt

Cartesian x-coordinate of cell across entire tissue sample (across all frames).

Yt

Cartesian y-coordinate of cell across entire tissue sample (across all frames)

Source

Shortened version of t-CyCIF single-cell data of Pancreatic Ductal Adenocarcinoma (PDAC) resection specimen from Lin et. al with only the cartesian coordinates and frames each cell is in present.

Entire dataset can be downloaded from http://lincs.hms.harvard.edu/wordpress/wp-content/uploads/2017/05/rawdata_Figure78_PDAC.zip

References

Lin et al. (2018) eLife 2018;7:e31657 (eLife)


Creates a scatterplot with hatched patterns.

Description

This function creates a scatterplot with hatched patterns by using geom_segment(). Also creates the legend to represent each hatched group. The aesthetics defining each pattern, like the lineType and lineColor are all passed to geom_segment().

Usage

scatterHatch(
  data,
  x,
  y,
  color_by,
  legendTitle = "",
  pointSize = 1,
  pointAlpha = 0.5,
  gridSize = NULL,
  sparsePoints = NULL,
  patternList = NULL,
  colorPalette = NULL
)

Arguments

data

Dataset to be used

x

Column name of x-coordinates

y

Column name of y-coordinates

color_by

Column name of factor that defines groupings

legendTitle

Title of the legend

pointSize

Point size for the scatterplot

pointAlpha

Transparency of points in the scatterplot

gridSize

Controls the precision of the hatched pattern. Larger values correspond to greater precision. Default follows a exponential decay function based on point size.

sparsePoints

Logical Vector denoting points annotated as sparse. If NULL, default sparsity detector will be used to annotate sparse points.

patternList

Aesthetics to be passed for each pattern (must be a list where each element has a named pattern)

colorPalette

Colors to be used for each group. Default is color-blind friendly.

Value

ggplot2 object of scatterplot with hatched patterns for each group.

Examples

data(pdacData)
scatterHatch(pdacData, "Xt", "Yt", "frame")