subset_scores {GOexpress} | R Documentation

## Returns a filtered list from GO_analyse results.

### Description

Given an output variable from a `GO_analyse` analysis and a set of valid filters and thresholds, returns an identically formatted list keeping only the rows of the score table passing all the filters.

### Usage

    subset_scores(result, ...)

    # Suggested use:
    # on the output of GO_analyse()
    # subset_scores(result, total=5, namespace="BP")
    # or after application of pValue_GO()
    # subset_scores(result, total=5, namespace="BP", p.val=0.05)

### Arguments

`result` | The output of the `GO_analyse()` function.
`...` | Additional pairs of filter and threshold values in the format "filter=threshold". Filters must be valid names from colnames(result$GO).

### Details

It is highly recommended to filter out GO terms with very few genes (e.g. less than 5 genes), as the scoring function is biased for those GO terms (see UsersGuide).

Suggested filters:

total_count, total: | Filter keeping only GO terms associated with at least the given count of genes in the annotations provided.
p.val, p, P: | Filter keeping only the GO terms with P-value lower or equal to the given cutoff (This filter is only applicable after the use of the `pValue_GO` function).
namespace, namespace_1003: | Filter keeping only the GO terms of a given type. Valid values are "biological_process", "molecular_function", and "cellular_component". Abbreviations "BP", "MF", and "CC" are also accepted.

Additional filters:

data_count, data: | Filter keeping only GO terms associated with at least the given count of genes, present in the `ExpressionSet`.
ave_rank, rank: | Filter keeping only GO terms with an ave_rank value equal or lower than the given cutoff (average of the rank of all genes annotated to the GO term).
ave_score, score: | Filter keeping only GO terms with an ave_score value equal or higher than the given cutoff (average of the score of all genes annotated to the GO term) Scores are the mean decrease in Gini index for the random forest, or the F-value for the ANOVA approach.

### Value

A list formatted identically to the `result` object provided, with an added or updated `filters.GO` slot stating the filters and cutoffs applied, and restricted to:

- the gene ontologies passing the given filters and cutoff values.

- the genes mapped to those remaining ontologies (i.e. all genes not associated with an ontology are discarded in the output object).

- gene-mapping annotations related to the remaining gene ontologies.

### Note

It is possible to further filter a filter result object. Some warnings may appear if the new filter cutoff conflict with the ones previously applied (stored in the `filters.GO` slot of the filtered object). Example of conflicting filter values are:

- Filtering for `'biological_process'` a result object that was previously filtered for `'molecular_function'` (no more `'BP'` terms are present in the first filtered object).

- filtering for a `total_count` of 5 or more a result object previously filtered for a `total_count` of 10 or more.

### Author(s)

Kevin Rue-Albrecht

### See Also

Method `GO_analyse`.

### Examples

    # load the sample output data
    data(AlvMac_results.pVal)

    # have an overview of the result variable
    str(AlvMac_results.pVal)

    # filter for Biological Processes associated with 5+ genes and <=0.05 P-value
    filtered_results <- subset_scores(
        result=AlvMac_results.pVal, total_count=5, p.val=0.05,
        namespace="BP")

    # have an overview of the filtered result variable
    str(filtered_results)

[Package GOexpress version 1.26.0 Index]