scalpelStep2 {scalpel} | R Documentation |
Perform Step 2 of SCALPEL.
Description
This step involves refinement of the spatial component dictionary from Step 1. We eliminate redundancy in the spatial component dictionary by clustering together preliminary dictionary elements that represent the same neuron, based on spatial and temporal information.
Usage
scalpelStep2(step1Output, cutoff = 0.18, omega = 0.2, maxSizeToCluster = 3000)
Arguments
step1Output |
An object of class |
cutoff |
A value in [0,1] indicating where to cut the dendrogram that results from hierarchical clustering of the preliminary dictionary elements. The default value is 0.18. |
omega |
A value in [0,1] indicating how to weight spatial vs. temporal information in the dissimilarity metric
used for clustering. If |
maxSizeToCluster |
Optional advanced user argument: The maximum number of preliminary dictionary elements to cluster at once. We attempt to cluster each
overlapping set of preliminary dictionary elements, but if one of these sets is very large (e.g., >10,000), memory issues may
result. Thus we perform a two-stage clustering in which we first cluster together random sets of size
approximately equaling |
Details
Several files containing data from this step and a summary of the step are saved in the folder
"outputFolder/Step1_version/Step2_omega_omega_cutoff_cutoff" where version
is a 5-digit unique
identifier that is automatically generated in Step 1 and omega
and cutoff
are the user-supplied parameters.
Value
An object of class scalpelStep2
, which can be summarized using summary
, used to run SCALPEL Step 3 using scalpelStep3
,
or can be used with the plotting functions plotCluster
and plotSpatial
.
A
: A matrix containing the dictionary elements, where the ith column ofA
is a vector of 1's and 0's, indicating whether each pixel is contained in the ith dictionary element.repComps
: A vector where the ith element indicates which preliminary dictionary element is the ith representive component. That is,A[,i]=step1Output$Azero[,repComps[i]]
.clusterID
: A vector whose ith element indicates which of the dictionary elements inA
is the representative for the ith preliminary dictionary element.overlapSetID
: A vector indicating which preliminary dictionary elements overlap, with the ith element giving the group index for the ith preliminary dictionary element.treeList
: A list of lengthmax(overlapSetID)
with the ith element containing an object of classprotoclust
corresponding to prototype clustering for the preliminary dictionary elements withoverlapSetID=i
. If two-stage clustering was done for a particular set, then the element will beNULL
.Other elements: As specified by the user or returned from a previous step.
See Also
The entire SCALPEL pipeline can be implemented using the scalpel
function. The
other steps in the pipeline can be run using the scalpelStep0
, scalpelStep1
, scalpelStep3
functions.
Results from this step can be summarized using summary
, loaded at a later time using getScalpelStep2
, and plotted using
plotCluster
and plotSpatial
.
Examples
## 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 "scalpelStep1" function
#run Step 2 of SCALPEL
Step2Out = scalpelStep2(step1Output = Step1Out)
summary(Step2Out)
## End(Not run)