SPADE.driver: SPADE workflow driver

Description Usage Arguments Details Value Author(s) Examples

Description

A function to drive the SPADE workflow. Produces graphs annoated with parameter medians and fold change.

Usage

1
SPADE.driver(files, file_pattern="*.fcs", out_dir=".", cluster_cols=NULL, panels=NULL, comp=TRUE, arcsinh_cofactor=NULL, transforms=flowCore::arcsinhTransform(a=0, b=0.2), downsampling_target_number=NULL, downsampling_target_pctile=NULL, downsampling_target_percent=0.1, downsampling_exclude_pctile=0.01, k=200, clustering_samples=50000, layout=igraph:::layout.kamada.kawai, pctile_color=c(0.02,0.98), fcs_channel_mappings_json=NULL) 

Arguments

files

Either a vector of FCS files, or a directory. If a directory, all of the *.fcs files in the directory are processed.

file_pattern

Wildcard pattern to match file if files is a director.

out_dir

Directory where output files are written. Will be created if it does not exist.

cluster_cols

Usually a vector of strings specifying the columns to be used in the clustering, e.g., c("(Cd110)D","(Cs111)D"). Strings will be matched against the parameter names extracted from the FCS file. The default=NULL will use all parameters.

panels

List of panels for median and fold change calculations. See details for specific structure. If NULL, medians are computed for all markers in all files.

comp

Apply compensation matrix if present in SPILL or SPILLOVER keywords.

arcsinh_cofactor

DEPRECATED. Cofactor used in arcsinh transform asinh(data/arcsinh_cofactor) of data.

transforms

Transform object to apply to data. A single transform object will be applied to all channels. To apply different transforms to specific channels use a named vector of transform objects (where names are parameter names).

downsampling_target_number

Desired number of events remaining after downsampling files. Only meaningful if 'downsampling_target_percent' and 'downsampling_target_pctile' are 'NULL'.

downsampling_target_pctile

Numeric value in [0,1]. Densities below this percentile, but above 'exclude_pctile' will be retained during downsampling. Only meaningful if 'downsampling_target_number' and 'downsampling_target_percent' are 'NULL'.

downsampling_target_percent

Numeric value in [0,1]. Desired percent of events remaining after downsampling files. Percent is per-file (e.g. 0.1 is 10% of each file). Only meaningful if 'downsampling_target_number' and 'downsampling_target_pctile' are 'NULL'.

downsampling_exclude_pctile

Numeric value in [0,1]. Densities below this percentile will be excluded during downsampling.

k

Desired number of clusters.

clustering_samples

Desired number of events (randomly selected) to be used in clustering after downsampling.

layout

Layout function.

pctile_color

A two-element vector specifying lower and upper percentiles that should be used to set the color scale. Values below and above these percentiles will be forced to the 'smallest' and 'largest' color respectively. Not in effect if 'scale' is specified. Relevant for downstream tools that used global value ranges produced by driver.

Details

The panels argument must be null or a list of panel descriptors, which are themselves lists containing at minimum a vector of panel files and median cols. An example minimum panels argument would be list( list(panel_files="basal.fcs", median_cols=NULL)) . panel_files is a single file name or vector of file names in the experiment. median_cols is similar to the cluster_cols argument. Each panel descriptor can optionally specifiy reference_files and columns for fold change analysis. An example full panel descriptor would be list( list(panel_files=c("basal.fcs", "stim.fcs"), median_cols=NULL, reference_files="basal.fcs", fold_cols=("p1"))) . fold_cols is similar to the cluster_cols argument. reference_files is a single file name or vector of file names in the experiment and in the panel_files for this experiment. median_cols and fold_cols are only interpreted in the context on their panel files, and so partially overlapping panels are possible. However, all the files specified within a panel must have the cluster, median and fold change parameters specified.

Value

NULL

Author(s)

Michael Linderman

Examples

1
2
3
4
5
6
7
	# Load two-parameters sample data included in package
	data_file_path = system.file(file.path("extdata","SimulatedRawData.fcs"), package = "spade")

	# Run basic SPADE analyses, clustering on two parameters. Annotated graphs will be
	# in output_dir. See SPADE.plot.trees to generate PDFs of annotated graphs.
	output_dir <- tempdir()
	SPADE.driver(data_file_path, out_dir=output_dir, cluster_cols=c("marker1","marker2"))

olimora/mySPADE documentation built on May 9, 2019, 8:09 p.m.