# 1. Get Public Gene Expression Data

For this example, we will work through a small gene expression meta-analysis of systemic lupus erythematosus (SLE). We have identified public datasets that we will download from GEO for this analysis.

#Download the data from GEO, this can take a little while
sleData <- getGEOData(c("GSE11909","GSE50635", "GSE39088"))

## MetaScore Classification Performance

Receiver operating characteristic (ROC) curves and precision-recall (PRC) curves can be used to demonstrate the classification performance of the MetaScore.

rocPlot(datasetObject = sleMetaAnalysis$originalData$GSE5063, filterObject = sleMetaAnalysis$filterResults[[1]]) ### Multiple ROC Curves Draw multiple ROC curves. multipleROCPlot(metaObject = sleMetaAnalysis, filterObject = sleMetaAnalysis$filterResults[[1]])

Draw multiple ROC curves with a summary ROC curve that represents an overall ROC estimate.

summaryROCPlot(metaObject = sleMetaAnalysis, filterObject = sleMetaAnalysis$filterResults[[1]], bootstrapReps = 100) Draw multiple ROC curves with a pooled ROC curve that represents a moving average ROC. pooledROCPlot(metaObject = sleMetaAnalysis, filterObject = sleMetaAnalysis$filterResults[[1]])

### Single PRC Plot

Draw a single PRC plot.

## Understand Sample Phenotypes

### Violin plot

With a violin plot, you can drill into subgroups within datasets to observe differences between populations, with the individual samples called out.

## Forest plot

Forest plots allow us to examine individual genes across studies.

forestPlot(geneName="IFI44L", metaObject = sleMetaAnalysis)

### immunoStates Deconvolution

immunoStates is a tool for estimating immune cell proportions based on gene expression profiles. immunoStateMeta() in MetaIntegrator allow you to estimate cell proportions, then use these cell proportions as input for a downstream meta-analysis (in place of genes).

immunoMeta <- immunoStatesMeta( metaObject = sleMetaAnalysis)

immunoStates can also correct the underlying gene expression data for differences in cell proportions

sleMetaImmuneCorrected <- immunoStatesDecov( metaObject = sleMetaAnalysis)
sleMetaImmuneCorrected <- immunoStatesGenePropCorr( metaObject = sleMetaImmuneCorrected)

### LINCS tools

LINCS tools allows users to compare disease gene expression signatures to perturbation expression signatures identified by the LINCS consortium. lincsTools() will generate a broadly useful report of many different classes of molecules. The call to lincsCorrelate(), below, is one particular example of looking for a drug with a gene expression profile that reverses the SLE profile. Note that this requires downloading a significant amount of data, so the first execution will be slow.

lincsHits <- lincsCorrelate( metaObject = sleMetaAnalysis, filterObject = sleMetaAnalysis$filterResults[[1]], dataset = "CP", direction = "reverse") ### Impute sex Based on known marker genes, impute sex of samples. This can be useful for identifying sample labeling errors. imputedSex <- imputeSex( myDataset = sleMetaAnalysis$originalData\$GSE11909_GPL96)
head(imputedSex)

### COCONUT

COCONUT is a separate R package for correcting batch effects to merge multiple datasets into a single dataset. This is a wrapper function to call COCONUT on a MetaIntegrator object.

coconutRes <- coconutMetaIntegrator( metaObject = sleMetaAnalysis)

### Pathway Analysis

Pathway analysis is commonly performed to provide biological interpretation for experiments. This is a wrapper function for deapathways, one R package for performing pathway analysis.
NOTE: This functionality will be added in future updates to MetaIntegrator

#pathwayRes <- pathwayAnalysis( metaObject = sleMetaAnalysis)