plotTemporal: Plot temporal components from Step 3 of SCALPEL.

Description Usage Arguments Details Value See Also Examples

View source: R/SCALPEL_graphics.R

Description

We plot the temporal components, displaying the estimated fluorescence over time for each spatial component, which result from running Step 3 of SCALPEL.

Usage

1
2
3
4
5
6
7
8
9
plotTemporal(
  scalpelOutput,
  neuronsToDisplay = NULL,
  colVec = NULL,
  ylab = "",
  title = "",
  fileName = NULL,
  lambdaIndex = NULL
)

Arguments

scalpelOutput

An object returned by one of these SCALPEL functions: scalpel or scalpelStep3.

neuronsToDisplay

Vector giving which neurons' temporal components to plot. The indices refer to which rows of scalpelOutput$Zhat to plot. By default, all components are plotted. Users may also specify "kept", which will exclude all dictionary elements discarded using a previous call to reviewNeurons or reviewNeuronsInteractive.

colVec

Vector of colors to use, which are chosen automatically if the default value of NULL is used.

ylab

Label for the y-axis.

title

Label for the title.

fileName

If provided, the plot will be saved to the specified location.

lambdaIndex

Optional advanced user argument: Index of lambda value for which results will be plotted. Default is to use lambda value of scalpelOutput$lambda but specifying this will use the lambda value of scalpelOutput$lambdaSeq[lambdaIndex].

Details

If lambdaIndex is NULL, each temporal component is scaled by its largest value. If lambdaIndex is specified, each temporal component is scaled by its largest value across all of the lambda values. Temporal components that were zeroed out in the sparse group lasso are omitted from the plot.

Value

None

See Also

scalpelStep3, scalpel, plotResults

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
### many of the functions in this package are interconnected so the
### easiest way to learn to use the package is by working through the vignette,
### which is available at ajpete.com/software

#assumes you have run the example for the "scalpel" function

#simplest example with default parameters:
plotTemporal(scalpelOutput = scalpelOutput)

#example with optional parameters:
#plot only two of the neurons and add a title
plotTemporal(scalpelOutput = scalpelOutput, neuronsToDisplay = c(1,2),
             title = "First two neurons")

## End(Not run)

scalpel documentation built on Feb. 3, 2021, 9:05 a.m.