diffusion-funs: Functions to apply diffusion in graphs

Description Usage Arguments Value Examples

Description

Function diffusion.input computes the diffusion input score to perform diffusion in graphs. It uses the functions diffusion.input.Binary and diffusion.input.probability

Function diffusion.input.Binary computes the binary diffusion input score.

Function diffusion.input.probability computes the probability diffusion input score.

Function finalResults prepares the final table ranked by the diffusion scores computed.

Function modifiedTabs prepares the tables that result from the matching stage and the filtering stage to evaluate their performance.

Function set.diffusion diffuses heat in a specific Kernel given a matrix of compounds and its diffusion input score.

Usage

 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
diffusion.input(
  df,
  input.type = "probability",
  background = NULL,
  Unique.Annotation = FALSE,
  do.Par = TRUE,
  nClust = 2
)

diffusion.input.Binary(df, do.Par = TRUE, nClust = 2)

diffusion.input.probability(df, do.Par = TRUE, nClust = 2)

finalResults(Diff.Tab, score, do.Par = TRUE, nClust)

modifiedTabs(df, do.Par = TRUE, nClust)

set.diffusion(
  df,
  graph = NULL,
  graph.name = "fella",
  K = NULL,
  scores = c("raw", "ber_s", "z"),
  do.Par = TRUE,
  nClust = 2
)

Arguments

df

Object returned by the diffusion.input function. It is a list containing the diffusion input matrix (data frame containing a column named "Compound" with the KEGG identifiers of the potential candidates and a column named "Diffusion.Input") and a character vector indicating the diffusion input type.

input.type

Diffusion input type per compound. "binary" 1 if the compound is proposed. "probability" computes the probability of existence of each compound.

background

Vector containing a list of KEGG identifiers which will be set to 0 in the diffusion process. This will have an effect in the normalization process performed when using the z score. If NULL, the background will be set to all the compounds available in df.

Unique.Annotation

Logical (only available when input type="binary"). If TRUE, the binary diffusion input is computed by only considering those peaks with a unique annotation (Def: FALSE).

do.Par

TRUE if parallel computing is required. Def: TRUE

nClust

Number of clusters that may be used. Def: Number of clusters - 1.

Diff.Tab

Data frame that results from the diffusion step.

score

Method of diffusion. Possible values are: "raw", "ber_s" and "z"

graph

Diffusion graph where nodes correspond to KEGG compounds. If NULL, the diffusion graph indicated in graph.name will be loaded.

graph.name

Name of the diffusion graphs available in mWISE. The options are "fella", "RClass3levels" or "RClass2levels" (Def: "fella").

K

Regularised Laplacian kernel. If NULL, it will be computed using the regularisedLaplacianKernel function from DiffuStats R package.

scores

Method of diffusion. Def: c("raw", "ber_s", "z")

Value

Function diffusion.input returns a list containing the diffusion input data frame and a character specifying the diffusion input type.

Function diffusion.input.Binary returns a data frame containing the binary diffusion input.

Function diffusion.input.probability returns a data frame containing the probability diffusion input.

Function finalResults returns a table containing the final potential candidates ranked by diffusion score.

Function modifiedTabs returns a table containing the potential candidates in a specific mWISE stage without repeated peaks.

Function set.diffusion returns a list containing the diffusion results, the compounds discarded during the diffusion process, the compounds present in the network and the background used.

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
41
42
43
44
45
46
47
48
data("sample.keggDB")
Cpd.Add <- CpdaddPreparation(KeggDB = sample.keggDB, do.Par = FALSE)
data(sample.dataset)
Peak.List <- sample.dataset$Positive$Input
Annotated.List <- matchingStage(Peak.List = Peak.List, Cpd.Add = Cpd.Add,
                                polarity = "positive", do.Par = FALSE)
Intensity.idx <- seq(27,38)
clustered <- featuresClustering(Peak.List = Peak.List, 
                                Intensity.idx = Intensity.idx, 
                                do.Par = FALSE)
Annotated.Tab <- Annotated.List$Peak.Cpd
Annotated.Tab <- merge(Annotated.Tab,
                       clustered$Peak.List[,c("Peak.Id", "pcgroup")],
                       by = "Peak.Id")
                       
MH.Tab <- clusterBased.filter(df = Annotated.Tab, 
                              polarity = "positive")
Input.diffusion <- diffusion.input(df = MH.Tab,
                                  input.type = "probability",
                                  Unique.Annotation = FALSE,
                                  do.Par = FALSE)
data("sample.keggDB")
Cpd.Add <- CpdaddPreparation(KeggDB = sample.keggDB, do.Par = FALSE)
data(sample.dataset)
Peak.List <- sample.dataset$Positive$Input
Annotated.List <- matchingStage(Peak.List = Peak.List, Cpd.Add = Cpd.Add,
                                polarity = "positive", do.Par = FALSE)
Intensity.idx <- seq(27,38)
clustered <- featuresClustering(Peak.List = Peak.List, 
                                Intensity.idx = Intensity.idx, 
                                do.Par = FALSE)
Annotated.Tab <- Annotated.List$Peak.Cpd
Annotated.Tab <- merge(Annotated.Tab,
                       clustered$Peak.List[,c("Peak.Id", "pcgroup")],
                       by = "Peak.Id")
                       
MH.Tab <- clusterBased.filter(df = Annotated.Tab, 
                              polarity = "positive")
Input.diffusion <- diffusion.input(df = MH.Tab,
                                  input.type = "probability",
                                  Unique.Annotation = FALSE,
                                  do.Par = FALSE)
data("sample.graph")
gMetab <- igraph::as.undirected(sample.graph)
diff.Cpd <- set.diffusion(df = Input.diffusion,
                          scores = "z",
                          graph = gMetab,
                          do.Par = FALSE)

b2slab/mWISE documentation built on Feb. 2, 2022, 12:24 a.m.