citrus.extractModelFeatures: Report model features at pre-specified thresholds.

View source: R/citrus.model.R

citrus.extractModelFeaturesR Documentation

Report model features at pre-specified thresholds.

Description

Report model features at pre-specific thresholds. For predictive models, reports non-zero model features at specified regularization thresholds. For FDR-constrained models, reports features below specified false discovery rates.

Usage

citrus.extractModelFeatures(cvMinima, finalModel, finalFeatures)

Arguments

cvMinima

List of regularization indicies at which to extract model features, produced by citrus.getCVMinima.

finalModel

Predictive model from which to extract non-zero features.

finalFeatures

Features used to construct finalModel.

Value

List of significant features and clusters at specified thresholds.

Author(s)

Robert Bruggner

Examples

# 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"))

# Read the data
citrus.combinedFCSSet = citrus.readFCSSet(dataDirectory,fileList)

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

# Cluster data
citrus.clustering = citrus.cluster(citrus.combinedFCSSet,clusteringColumns)

# Large enough clusters
largeEnoughClusters = citrus.selectClusters(citrus.clustering)

# Build features
abundanceFeatures = citrus.calculateFeatures(citrus.combinedFCSSet,clusterAssignments=citrus.clustering$clusterMembership,clusterIds=largeEnoughClusters)

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

# Calculate regularization thresholds
regularizationThresholds = citrus.generateRegularizationThresholds(abundanceFeatures,labels,modelType="pamr",family="classification")

# Calculate CV Error rates
thresholdCVRates = citrus.thresholdCVs.quick("pamr",abundanceFeatures,labels,regularizationThresholds,family="classification")

# Get pre-selected CV Minima
cvMinima = citrus.getCVMinima("pamr",thresholdCVRates)

# Build Final Model
finalModel = citrus.buildEndpointModel(abundanceFeatures,labels,family="classification",type="pamr",regularizationThresholds)

# Get model features
citrus.extractModelFeatures(cvMinima,finalModel,abundanceFeatures)

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