bandle-plots-spatial: Generate a PCA plot with smoothed probability contours

spatial2DR Documentation

Generate a PCA plot with smoothed probability contours

Description

Generate a PCA plot with smoothed probability contours

Usage

spatial2D(
  object,
  params,
  fcol = "markers",
  dims = c(1, 2),
  cov.function = NULL,
  theta = 2,
  derivative = 2,
  k = 1,
  cond = 1,
  n = 1,
  breaks = c(0.99, 0.95, 0.9, 0.85, 0.8, 0.75, 0.7),
  aspect = 0.5
)

Arguments

object

An instance of class MSnSet to provide the pca coordinates

params

An instance of class bandleParams

fcol

Feature columns that defines the markers. Defaults to "markers".

dims

The PCA dimensions to plot. Defaults to c(1,2)

cov.function

The covariance function for the smoothing kernel. Defaults to wendland.cov

theta

The theta parameter of the wendland.cov. Defaults to 2.

derivative

The derivative paramter of the wendland.cov. Defaults to 2.

k

The k parameter of the wendland.cov

cond

Which conditions do we want to plot. Must be 1 or 2. Default is 1

n

The chain from which we plot the probability distribution. Default is 1.

breaks

The levels at which to plot the contours. Defaults to c(0.99, 0.95, 0.9, 0.85, 0.8, 0.75, 0.7)

aspect

The aspect ratio of the pca plots. Defaults to 0.5.

Value

returns a named vector of differential localisation probabilities

Examples

 ## Not run: 
## Generate some example data
library("pRolocdata")
data("tan2009r1")
set.seed(1)
tansim <- sim_dynamic(object = tan2009r1, 
                      numRep = 4L,
                      numDyn = 100L)
data <- tansim$lopitrep
control <- data[1:2]
treatment <- data[3:4]

## fit GP params
gpParams <- lapply(tansim$lopitrep, function(x) 
fitGPmaternPC(x, hyppar = matrix(c(0.5, 1, 100), nrow = 1)))

## run bandle
res <- bandle(objectCond1 = control,
              objectCond2 = treatment, 
              gpParams = gpParams,
              fcol = "markers",  
              numIter = 5L, 
              burnin = 1L, 
              thin = 2L,
              numChains = 1, 
              BPPARAM = SerialParam(RNGseed = 1),
              seed = 1)
               
## Process the results
bandleres <- bandleProcess(res)

## plot the results
spatial2D(control[[1]], bandleres)

## End(Not run)

ococrook/bandle documentation built on Nov. 4, 2024, 12:27 a.m.