fea2incidMat: Transforms FEA output into incidence matrices.

Description Usage Arguments Value See Also Examples

View source: R/2_fea2incidMat.R

Description

Transforms the Funtional Enrichment Analysis (FEA) results into cluster-gene incidence matrices.

Usage

1
2
3
fea2incidMat(feaResults, key = "Genes", sepChar = NULL, clusterColumn = NULL, 
    filterAttribute = NULL, filterOperator = "<", filterThreshold = 0, 
    removeFilteredGtl = NULL)

Arguments

feaResults

list or data.frame/matrix. Output from one of the FEA functions.

key

"Genes" or "Terms". To build gene- or term-based networks.

sepChar

character. Character separating genes or terms in the same field. By default: "," for genes and ";" for terms.

clusterColumn

character. Name of the column that contains the value to group gene-term sets. Only required if it is different than "Cluster" or "Metagroup".

filterAttribute

character or data.frame. Attribute to filter the clusters/metagroups. Filtered clusters/metagroups will not be included in the matrices (and subsequent networks). Its value should be the data.frame column to use for filtering. It can be provided as character (column name) or data.frame (subset of the data.frame with drop=FALSE).

filterOperator

character. Logical operator used for filtering. i.e. ">" (bigger than), "<=" (smaller or equal than), "==" (equal), "!=" (different), "%%" (included in),... The evaluation order is left to right: filterAttribute ">" filterThreshold, will filter out clusters with filter attribute bigger than the threshold.

filterThreshold

numeric. Sets the value to compare to.

removeFilteredGtl

logical. Only used by GeneTerm Linker term network. If FALSE, it includes generic terms filtered by GeneTerm Linker from final metagroups.

Value

List:

clustersMatrix or metagroupsMatrix

Incidende matrix with the genes or Terms in each cluster or metagroup.

gtSetsMatrix

Incidende matrix with the genes or Terms in each gene-term set

filteredOut

Clusters or metagroups which where filtered out and therefore not included in the incidence matrices. NULL if none.

See Also

Next step in the workflow: functionalNetwork()

Overview of the package: FGNet

Package tutorial: vignette("FGNet-vignette")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Not run: 
jobID <- 3907019
results <- fea_gtLinker_getResults(jobID)
incidMat <- fea2incidMat(results)

# Filtering (threshold)
incidMat <- fea2incidMat(results, 
    filterAttribute="Silhouette Width", filterThreshold=0.2)

incidMat$filteredOut
head(incidMat$metagroupsMatrix)
head(incidMat$gtSetsMatrix)

functionalNetwork(incidMat)
    
# Term-based network
incidMatTerms <- fea2incidMat(results, key="Terms")
functionalNetwork(incidMatTerms, plotOutput="dynamic")

# Including generic terms filterd by GtLinker from final metagroups:
incidMatTerms <- fea2incidMat(results, key="Terms",removeFilteredGtl=FALSE)
functionalNetwork(incidMatTerms, plotOutput="dynamic", plotType="bipartite")

# Filtering by keyword
keywords <- c("rna")
selectedGroups <- sapply(getTerms(results),
    function(x) 
    any(grep(paste("(", paste(keywords, collapse="|") ,")",sep=""), tolower(x))))

resultsCbind <- results
resultsCbind$metagroups <- cbind(results$metagroups,
    selectedKeywords=as.numeric(selectedGroups))

matSelectedGroups <- fea2incidMat(resultsCbind,
    filterAttribute="selectedKeywords", filterThreshold=1)

functionalNetwork(matSelectedGroups)
getTerms(results)[selectedGroups]

## End(Not run)

FGNet documentation built on Nov. 8, 2020, 5:43 p.m.