MIGSA {MIGSA} | R Documentation

## MIGSA execution

### Description

`MIGSA` runs a MIGSA execution. Functional analysis is done for each experiment by means of dEnricher and mGSZ.

### Usage

    MIGSA(igsaInputs, ...)

    ## S4 method for signature 'list'
    MIGSA(igsaInputs, geneSets = list())

### Arguments

`igsaInputs` | list of IGSAinput objects to execute.
`...` | not in use.
`geneSets` | (optional) named list of GeneSetCollection objects to be tested for enrichment (names must be unique). If provided then it will be tested in every IGSAinput, if not, each IGSAinput object must have its own list of GeneSetCollection.

### Value

A MIGSAres object.

### See Also

`IGSAinput-class`

`MIGSAres-class`

### Examples

    ## Lets simulate two expression matrices of 1000 genes and 30 subjects.
    nGenes <- 1000; # 1000 genes
    nSamples <- 30; # 30 subjects
    geneNames <- paste("g", 1:nGenes, sep = ""); # with names g1 ... g1000
    ## Create random gene expression data matrix.
    set.seed(8818);
    exprData1 <- matrix(rnorm(nGenes*nSamples),ncol=nSamples);
    rownames(exprData1) <- geneNames;
    exprData2 <- matrix(rnorm(nGenes*nSamples),ncol=nSamples);
    rownames(exprData2) <- geneNames;

    ## There will be 40 differentialy expressed genes.
    nDeGenes <- nGenes/25;
    ## Lets generate the offsets to sum to the differentialy expressed genes.
    deOffsets <- matrix(2*abs(rnorm(nDeGenes*nSamples/2)), ncol=nSamples/2);

    ## Randomly select which are the DE genes.
    deIndexes1 <- sample(1:nGenes, nDeGenes, replace=FALSE);
    exprData1[deIndexes1, 1:(nSamples/2)] <-
    exprData1[deIndexes1, 1:(nSamples/2)] + deOffsets;

    deIndexes2 <- sample(1:nGenes, nDeGenes, replace=FALSE);
    exprData2[deIndexes2, 1:(nSamples/2)] <-
    exprData2[deIndexes2, 1:(nSamples/2)] + deOffsets;

    exprData1 <- new("MAList",list(M=exprData1));
    exprData2 <- new("MAList",list(M=exprData2));

    ## 15 subjects with condition C1 and 15 with C2.
    conditions <- rep(c("C1", "C2"),c(nSamples/2,nSamples/2));

    nGSets <- 200; # 200 gene sets
    ## Lets create randomly 200 gene sets, of 10 genes each
    gSets <- lapply(1:nGSets, function(i) sample(geneNames, size=10));
    names(gSets) <- paste("set", as.character(1:nGSets), sep="");
    myGSs <- as.Genesets(gSets);

    fitOpts <- FitOptions(conditions);

    igsaInput1 <- IGSAinput(name="igsaInput1", expr_data=exprData1,
    fit_options=fitOpts, gene_sets_list=list(myGSs=myGSs));
    igsaInput2 <- IGSAinput(name="igsaInput2", expr_data=exprData2,
    fit_options=fitOpts, gene_sets_list=list(myGSs=myGSs));

    experiments <- list(igsaInput1, igsaInput2);

    ## Finally run MIGSA!
    ## Not run:
    migsaRes <- MIGSA(experiments);

    ## End(Not run)

[Package MIGSA version 1.8.1 Index]