scalpelStep0: Perform Step 0 of SCALPEL.

Description Usage Arguments Details Value See Also Examples

View source: R/SCALPEL_stepFunctions.R

Description

This step involves data pre-processing. We read in the raw data version of Y and perform standard pre-processing techniques in order to smooth the data both temporally and spatially, remove the bleaching effect, and calculate a standardized fluorescence.

Usage

1
2
3
4
5
6
7
scalpelStep0(
  outputFolder,
  rawDataFolder,
  videoHeight,
  fileType = "R",
  processSeparately = TRUE
)

Arguments

outputFolder

The existing directory where the results should be saved.

rawDataFolder

The directory where the raw data version of Y is saved. The data should be a PxT matrix, where P is the total number of pixels per image frame and T the number of frames of the video, for which the (i,j)th element contains the fluorescence of the ith pixel in the jth frame. To create Y, you should vectorize each 2-dimensional image frame by concatenating the columns of the image frame. If the data is saved in a single file, it should be named "Y_1.mat", "Y_1.rds", "Y_1.txt", or "Y_1.txt.gz" (depending on fileType), and if the data is split over multiple files, they should be split into chunks of the columns and named consecutively ("Y_1.mat", "Y_2.mat", etc.; "Y_1.rds", "Y_2.rds", etc.; "Y_1.txt", "Y_2.txt", etc.; or "Y_1.txt.gz", "Y_2.txt.gz", etc.).

videoHeight

The height of the video (in pixels).

fileType

Indicates whether raw data is an .rds (default value; fileType="R"), .mat (fileType="matlab"), .txt (fileType="text"), or .txt.gz (fileType="zippedText") file. Any text files should not have row or column names.

processSeparately

Logical scalar giving whether the multiple raw data files should be processed individually, versus all at once. Processing the files separately may be preferable for larger videos. The default value is TRUE; this argument is ignored if the raw data is saved in a single file.

Details

Several files containing data from this step and a summary of the step are saved in "outputFolder".

Value

An object of class scalpelStep0, which can be summarized using summary, used to run SCALPEL Step 1 using scalpelStep1, or can be used with the plotting functions plotFrame, plotThresholdedFrame, and plotVideoVariance.

See Also

The entire SCALPEL pipeline can be implemented using the scalpel function. The other steps in the pipeline can be run using the scalpelStep1, scalpelStep2, scalpelStep3 functions. Results from this step can be summarized using summary, loaded at a later time using getScalpelStep0, and plotted using plotFrame, plotThresholdedFrame, and plotVideoVariance.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## 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

#existing folder to save results (update this to an existing folder on your computer)
outputFolder = "scalpelResultsStepByStep"
#location on computer of raw data in R package to use
rawDataFolder = gsub("Y_1.rds", "", system.file("extdata", "Y_1.rds", package = "scalpel"))
#video height of raw data in R package
videoHeight = 30
#run Step 0 of SCALPEL
Step0Out = scalpelStep0(outputFolder = outputFolder,
                       rawDataFolder = rawDataFolder, videoHeight = videoHeight)
summary(Step0Out)

## End(Not run)

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