Learn R Programming

GOexpress (version 1.6.1)

pValue_GO: Compute p-values for ontologies by randomising gene labels.

Description

Permutes the rank of genes processed by GO_analyse() to compute a P-value for each ontology

Usage

pValue_GO( result, N=1000, ranked.by=result$rank.by, rank.by='P', FUN.GO=result$FUN.GO)

Arguments

result
The output of GO_analyse() or a subset of it obtained from subset_scores().
N
The number of permutation desired. Default to 1000.
ranked.by
Either of 'rank' or 'score'. The metric used to compare whether GO terms in the randomised data arelative to their original value. Default to the current ordering method of the result object.
rank.by
Either of 'rank', 'score', or 'p.val'. The metric used to order the GO terms after computing of the P-value. Default to 'p.val'.
FUN.GO
Function to summarise the score and rank of all feature associated with each gene ontology. Logically, default is the function used in the call to GO_analyse. If using "lambda-like" (anonymous) functions, these must take a list of numeric values as an input, and return a single numeric value as an output.

Value

A list formatted identically to the results of the analysis, with an added 'p.val' column in the GO slot, and re-ordered by the chosen metric.

Details

This function is relatively lengthy. Its procedure can be divided in several steps: (1) assemble a copy of all genes used in the original scoring step, then for each of the N permutations, (2) permute the gene labels, (3) aggregate the rank -- or score -- of all genes belonging to each GO term, (4) decide whether each GO term is ranked -- or scored --better or worst than originally, (5) return a p-value based on the number of permutations where each GO term was better ranked -- or scored -- than originally.

See Also

Method GO_analyse.

Examples

Run this code
## Not run: 
# # Time-consuming examples:
# # Limited here to N=1 for time constraint
# # Recommended N=1000 (or at least 100).
# 
# # Run the analysis on factor "Treatment" including all samples
# AlvMac.Pvals <- pValue_GO(result, N=1, ranked.by=result$rank.by, rank.by='P')
# ## End(Not run)

Run the code above in your browser using DataLab