make.counts.heatmap: Make a heatmap for NanoString counts

View source: R/make.counts.heatmap.R

make.counts.heatmapR Documentation

Make a heatmap for NanoString counts

Description

Make a heatmap of counts

Usage

make.counts.heatmap(
  nano.counts, fname.stem = NULL, covs.rows = NULL, covs.cols = NULL,
  clust.dim = 'both', clust.method = 'euclidean', print.ylab = NULL
  )

Arguments

nano.counts

A gene by sample matrix or data-frame of NanoString counts, where row names are probe names and column names are sample IDs. Counts can be normalized or raw.

fname.stem

To use in filename. Description of how CNAs were called is suggested. Defaults to NULL

covs.rows

A sample by covariate data-frame. Currently only accepts sample covariates 'Type' and 'Cartridge' (see output of load.phenodata). A 'SampleID' column is mandatory to match to 'nano.counts' sample IDs. Defaults to NULL

covs.cols

A gene by covariate data-frame. Currently only accepts gene covariate 'CodeClass'. A 'Name' column is mandatory to match to 'nano.counts' gene probe names. Defaults to NULL

clust.dim

Which dimensions to cluster. Accepts 'none', 'rows', 'columns', or 'both' (default)

clust.method

Which distance method should be used for clustering. Accepts 'euclidean' (default), 'correlation', 'jaccard', and other methods supported in ?dist

print.ylab

Whether to print the yaxis labels. Passed directly to the BoutrosLab.plotting.general::create.heatmap function. Leave as NULL (default) if you don't want them printed

Details

Make a clustered heatmap of counts for all samples and genes

Value

None

Author(s)

Cindy Yao and Emilie Lalonde

Examples

## Not run: 
  # load data
  data(NanoString.DNA.raw);
  data(NanoString.DNA.norm);
  data(PhenoData);

  # plot normalized NanoString counts
  make.counts.heatmap(
    nano.counts = NanoString.DNA.norm[, -(1:3)],
    fname.stem = 'normalized',
    covs.rows = PhenoData[, c('SampleID', 'Type', 'Cartridge')],
    covs.cols = NanoString.DNA.raw[, c('Name', 'CodeClass')]
    ); 

  # plot raw NanoString counts
  # make sure raw count data frame has gene names for rownames!
  NanoString.DNA.formatted <- NanoString.DNA.raw[, -(1:3)];
  rownames(NanoString.DNA.formatted) <- NanoString.DNA.raw$Name;

  make.counts.heatmap(
    nano.counts = NanoString.DNA.formatted,
    fname.stem = 'raw',
    covs.rows = PhenoData[, c('SampleID', 'Type', 'Cartridge')],
    covs.cols = NanoString.DNA.raw[, c('Name', 'CodeClass')]
    );

## End(Not run)

uclahs-cds/public-R-NanoStringNormCNV documentation built on May 31, 2024, 9:09 p.m.