mle.getMinPtDistance: Metabolite set enrichment analysis (MSEA) using pathway...

Description Usage Arguments Examples

View source: R/mle.getMinPtDistance.r

Description

A function that returns the pathway enrichment score for all perturbed metabolites in a patient's full metabolomic profile.

Usage

1
mle.getMinPtDistance(allSimMatrices)

Arguments

allSimMatrices

- A list of all similarity matrices, across all k for a given graph, or across many graphs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Get patient distances
data_mx.pvals = apply(data_mx, c(1,2), function(i) 2*pnorm(abs(i), lower.tail = FALSE))
res = list()
t = list(ncd=matrix(NA, nrow=ncol(data_mx), ncol=ncol(data_mx)))
rownames(t$ncd) = colnames(data_mx)
colnames(t$ncd) = colnames(data_mx)
for (i in 1:kmx) {
  res[[i]] = t
}
for (pt in 1:ncol(data_mx)) {
  print(pt)
  ptID = colnames(data_mx)[pt]
  for (pt2 in pt:ncol(data_mx)) {
    ptID2 = colnames(data_mx)[pt2]
    tmp = mle.getPtSim(ptBSbyK[[ptID]], ptID, ptBSbyK[[ptID2]], ptID2, data_mx, ranks)
    for (k in 1:kmx) {
      res[[k]]$ncd[ptID, ptID2] = tmp$NCD[k]
      res[[k]]$ncd[ptID2, ptID] = tmp$NCD[k]
    }
  }
}
patientSimilarity = mle.getMinPtDistance(res)

BRL-BCM/CTD documentation built on Feb. 7, 2020, 1:42 a.m.