AdjacencyMatrix: Wrapper to create an instance of S4 class AdjacencyMatrix

View source: R/AllClasses.R

AdjacencyMatrixR Documentation

Wrapper to create an instance of S4 class AdjacencyMatrix

Description

The function 'AdjacencyMatrix' will create an object of type 'AdjacencyMatrix'.

Usage

AdjacencyMatrix(
  adj_l,
  rowData,
  type = c("structural", "statistical", "combine"),
  directed = c(TRUE, FALSE),
  thresholded = c(TRUE, FALSE)
)

Arguments

adj_l

'list' of adjacency matrices

rowData

'data.frame', containing information on the features

type

'character', either '"structural"', '"statistical"', or '"combine"'

directed

'logical', if the adjacency matrix underlying the graph is directed or undirected

thresholded

'logical', if the functions 'rtCorrection' or 'threshold' were applied on the 'structural' or 'statistical' 'AdjacencyMatrix' objects

Details

'adj_l' is a list of adjacency matrices. The adjacency matrices have identical dimensions and 'dimnames' and each adjacency matrix has the same number of columns and rows and identical 'rownames' and 'colnames'. 'rowData' will be also used for the 'colData' slot (since the 'rownames' and 'colnames' are identical).

Value

object of S4 class 'AdjacencyMatrix'

Accessors

- The 'AdjacencyMatrix' class extends the [SummarizedExperiment::SummarizedExperiment] class and inherits all its accessors and replacement methods.

- The 'type' accessor returns the 'type' ('"structural"', '"statistical"', '"combine"') slot.

- The 'directed' accessor returns the 'directed' ('logical' of length 1) slot.

- The 'thresholded' accessor returns the 'thresholded' ('logical' of length 1) slot.

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

binary <- matrix(0, ncol = 10, nrow = 10)
transformation <- matrix("", ncol = 10, nrow = 10)
mass_difference <- matrix("", ncol = 10, nrow = 10)

rownames(binary) <- rownames(transformation) <- rownames(mass_difference) <- paste("feature", 1:10)
colnames(binary) <- rownames(transformation) <- rownames(mass_difference) <- paste("feature", 1:10)

binary[5, 4] <- 1
transformation[5, 4] <- "glucose addition"
mass_difference[5, 4] <- "162"

## create adj_l and rowData
adj_l <- list(binary = binary, transformation = transformation, 
    mass_difference = mass_difference)
rowData <- DataFrame(features = rownames(binary),
    row.names = rownames(binary))

AdjacencyMatrix(adj_l = adj_l, rowData = rowData, type = "structural", 
    directed = TRUE, thresholded = FALSE)


tnaake/MetNet documentation built on June 30, 2022, 10:50 a.m.