fishScaleAndMap: Scale mFISH data and map to RNA-seq reference

View source: R/mfishMapping.r

fishScaleAndMapR Documentation

Scale mFISH data and map to RNA-seq reference

Description

This function is a wrapper for several other functions which aim to scale mFISH data to more closely match RNA-seq data and then map the mFISH data to the closest reference classes. There are several parameters allowing flexability in filtering and analysis.

Usage

fishScaleAndMap(
  mapDat,
  refSummaryDat,
  genesToMap = NULL,
  mappingFunction = cellToClusterMapping_byCor,
  transform = function(x) x,
  noiselevel = 0,
  scaleFunction = quantileTruncate,
  omitGenes = NULL,
  metadata = data.frame(experiment = rep("all", dim(mapDat)[2])),
  integerWeights = NULL,
  binarize = FALSE,
  binMin = 0.5,
  ...
)

Arguments

mapDat

normalized data of the MAPPING data set. Default is to map the data onto itself.

refSummaryDat

normalized summary data of the REFERENCE data set (e.g., what to map against)

genesToMap

which genes to include in the mapping (calculated in not entered)

mappingFunction

which function to use for mapping (default is cellToClusterMapping_byCor) The function must include at least two parameters with the first one being mapped data and the second data the reference. Additional parameters are okay. Output must be a data frame where the first value is a mapped class. Additional columns are okay and will be returned)

transform

function for transformation of the data (default in none)

noiselevel

scalar value at or below which all values are set to 0 (default is 0)

scaleFunction

which function to use for scaling mapDat to refSummaryDat (default is setting 90th quantile of mapDat to max of refSummaryDat and truncating higher mapDat values)

omitGenes

genes to be included in the data frames but excluded from the mapping

metadata

a data frame of possible metadata (additional columns are okay and ignored):

area

a vector of cell areas for normalization

experiment

a vector indicating if multiple experiments should be scaled separately

x,y

x (e.g., parallel to layer) and y (e.g., across cortical layers) coordinates in tissue

integerWeights

if not NULL (default) a vector of integers corresponding to how many times each gene should be counted as part of the correlation. This is equivalent to calculating a weighted correlation, but only allows for integer weight values (for use with cor).

binarize

should the data be binarized? (default=FALSE)

binMin

minimum ON value for the binarized matrix (ignored if binarize=FALSE)

...

additional parameters for passthrough into other functions

Value

a list with the following entrees:

mapDat

mapDat data matrix is passed through

scaleDat

scaled mapDat data matrix

mappingResults

Results of the mapping and associated confidence values (if any)

metadata=metadata

metadata is passed through unchanged

scaledX/Y

scaled x and y coordinates (or unscaled if scaling was not performed)


AllenInstitute/mfishtools documentation built on July 5, 2023, 4:20 p.m.