tidySet: Create a TidySet object

View source: R/tidy-set.R

tidySet.GeneSetCollectionR Documentation

Create a TidySet object

Description

These functions help to create a TidySet object from data.frame, list, matrix, and GO3AnnDbBimap. They can create both fuzzy and standard sets.

Usage

## S3 method for class 'GeneSetCollection'
tidySet(relations)

## S3 method for class 'GeneColorSet'
tidySet(relations)

## S3 method for class 'GeneSet'
tidySet(relations)

tidySet(relations)

## S3 method for class 'data.frame'
tidySet(relations)

## S3 method for class 'list'
tidySet(relations)

## S3 method for class 'matrix'
tidySet(relations)

## S3 method for class 'Go3AnnDbBimap'
tidySet(relations)

## S3 method for class 'TidySet'
tidySet(relations)

Arguments

relations

An object to be coerced to a TidySet.

Details

Elements or sets without any relation are not shown when printed.

Value

A TidySet object.

Methods (by class)

  • tidySet(GeneSetCollection): Converts to a tidySet given a GeneSetCollection

  • tidySet(GeneColorSet): Converts to a tidySet given a GeneColorSet

  • tidySet(GeneSet): Converts to a tidySet given a GeneSet

  • tidySet(data.frame): Given the relations in a data.frame

  • tidySet(list): Convert to a TidySet from a list.

  • tidySet(matrix): Convert an incidence matrix into a TidySet

  • tidySet(Go3AnnDbBimap): Convert Go3AnnDbBimap into a TidySet object.

  • tidySet(TidySet): Convert TidySet into a TidySet object.

See Also

TidySet

Examples

# Needs GSEABase package from Bioconductor
if (requireNamespace("GSEABase", quietly = TRUE)) {
    library("GSEABase")
    gs <- GeneSet()
    gs
    tidySet(gs)
    fl <- system.file("extdata", "Broad.xml", package="GSEABase")
    gs2 <- getBroadSets(fl) # actually, a list of two gene sets
    TS <- tidySet(gs2)
    dim(TS)
    sets(TS)
}
relations <- data.frame(
    sets = c(rep("a", 5), "b"),
    elements = letters[seq_len(6)]
)
tidySet(relations)
relations2 <- data.frame(
    sets = c(rep("A", 5), "B"),
    elements = letters[seq_len(6)],
    fuzzy = runif(6)
)
tidySet(relations2)
# A
x <- list("A" = letters[1:5], "B" = LETTERS[3:7])
tidySet(x)
# A fuzzy set taken encoded as a list
A <- runif(5)
names(A) <- letters[1:5]
B <- runif(5)
names(B) <- letters[3:7]
relations <- list(A, B)
tidySet(relations)
# Will error
# x <- list("A" = letters[1:5], "B" = LETTERS[3:7], "c" = runif(5))
# a <- tidySet(x) # Only characters or factors are allowed as elements.
M <- matrix(c(1, 0.5, 1, 0), ncol = 2,
            dimnames = list(c("A", "B"), c("a", "b")))
tidySet(M)

llrs/BaseSet documentation built on Feb. 22, 2025, 9:52 p.m.