citrus.full: Perform a full Citrus analysis

View source: R/citrus.full.R

citrus.fullR Documentation

Perform a full Citrus analysis

Description

This function takes FCS data, identifies cell subsets using clustering, characterizes the behavior of each identified cluster on a per-sample basis, and identifies cluster properties associated with an endpoint.

Usage

citrus.full(fileList, labels, clusteringColumns, dataDirectory,
  outputDirectory = NULL, family = "classification",
  modelTypes = c("glmnet"), nFolds = 1, conditionComparaMatrix = NULL,
  ...)

print.citrus.full.result(citrus.full.result, ...)

Arguments

fileList

A data frame containing the names of FCS files to be analyzed. Each column should contain FCS files measured in the same condition. Each row should contain FCS files measured from the same individual under different conditions. See examples below.

labels

A vector containing the experimental endpoint values for each row of FCS files in the fileList.

clusteringColumns

A vector containing the names or indices of parameters to be used for clustering.

dataDirectory

The full path to the directory containing FCS files.

outputDirectory

The full path to directory analysis output should be placed in. If not NULL, clustering is saved.

family

Type of association model to be calculated. Valid values are currently classification and continuous.

modelTypes

Vector of model types to be used to detect associations with experimental endpoint. Valid values are glmnet, pamr, and sam.

nFolds

Number of independent clustering folds to be used for model fitting. Should only be >1 if using glmnet or pamr models. Default value is 1 and all samples are clustered together.

conditionComparaMatrix

matrix of condition data to compare. See details.

...

Other arguments to be passed to citrus.readFCSSet, citrus.calculateFeatures, citrus.endpointRegress. Useful additional arguments listed in details.

Details

Citrus is able to analyze FCS data from single conditions or relative to a given baseline (i.e. stimulated values relative to an unstimulated baseline). Tell Citrus to compare conditions using the conditionComparisonMatrix argument. The conditionComparisonMatrix is an n x n matrix of logical values indicating which conditions should be compared where n is the number of experimental conditions specified in the fileList. Rows and columns names of the conditionComparsion matrix should be the names of experimental conditions in the fileList. A matrix entry of TRUE indicates that Citrus should calculate the value features in column name relative to feature values in the row name. TRUE entries on the diagonal means conditions are analyzed by themselves. See Examples.

Other useful arguments to pass to citrus.full include:

  • fileSampleSize: The number of cells to select from each sample. See citrus.readFCSSet.

  • transformColumns: Vector of parameter names or indicies whose values should transformed. See citrus.readFCSSet.

  • transformCofactor: Cofactor for arcsin-hyperbolic transform. See citrus.readFCSSet.

  • featureType: The descriptive feature type to be calculated for each cluster. See citrus.calculateFeatures.

  • minimumClusterSizePercent: The minimum cluster size as a percentage of total sampled cells. See citrus.calculateFeatures.

Value

A citrus.full.result object with the following properties:

citrus.combinedFCSSet

A citrus.combinedFCSSet object containing data read from files.

citrus.foldClustering

A citrus.foldClustering object that contains clustering results.

conditionFoldFeatures

A list of citrus.foldFeatureSet objects used for regression, one list element for each set of analyzed conditions.

conditionRegressionResults

A list of citrus.regressionResult objects, one entry for each set of analyzed condition.

family

The family of the regression model.

labels

Endpoint labels of the analyzed samples.

conditions

List of analyzed conditions.

modelTypes

Vector of regression models used to test for endpoint associations.

Author(s)

Robert Bruggner

See Also

citrus.readFCSSet, citrus.cluster,citrus.calculateFeatures, and citrus.endpointRegress

Examples

# Example with a single experimental condition (unstimulated data)
# Where the data lives
dataDirectory = file.path(system.file(package = "citrus"),"extdata","example1")

# Create list of files to be analyzed
fileList = data.frame("unstim"=list.files(dataDirectory,pattern=".fcs"))

# List disease group of each sample
labels = factor(rep(c("Healthy","Diseased"),each=10))

# List of columns to be used for clustering
clusteringColumns = c("Red","Blue")

# Run citrusAnalysis
results = citrus.full(fileList,labels,clusteringColumns,dataDirectory)

# Should be used to plot results
# plot(results, outputDirectory="/path/to/outputDirectory")

############################################

# Example using multiple experimental conditions, including a
# comparison of stimulated to unstimulated damples

# Where the data lives
dataDirectory = file.path(system.file(package = "citrus"),"extdata","example2")

# Create list of files to be analyzed
fileList = data.frame(unstim=list.files(dataDirectory,pattern="unstim"),stim1=list.files(dataDirectory,pattern="stim1"))

# Disease group of each sample
labels = factor(rep(c("Healthy","Diseased"),each=10))

# Vector of parameters to be used for clustering
clusteringColumns = c("LineageMarker1","LineageMarker2")

# Vector of parameters to calculate medians for
functionalColumns = c("FunctionalMarker1","FunctionalMarker2")

# Form condition comparison matrix to tell Citrus which conditions to analyze compare
conditionComparaMatrix = matrix(T,nrow=2,ncol=2,dimnames=list(colnames(fileList),colnames(fileList)))
conditionComparaMatrix[2]=F

# Run citrusAnalysis
results = citrus.full(fileList,labels,clusteringColumns,dataDirectory,
                      conditionComparaMatrix=conditionComparaMatrix,
                      featureType="medians",
                      medianColumns=functionalColumns)

# Result should be plotted
# plot(results,outputDirectory="/path/to/outputDirectory")

nolanlab/citrus documentation built on April 19, 2024, 6:49 p.m.